def lambda_handler(event, context):
    try:
        metrics = awslogs_handler(event, context)
        for metric in metrics:
            for key in metric:
                lambda_metric(convert_snake_case(key.replace('-', '_')),
                              metric[key],
                              tags=[DD_TAGS])
    except Exception as e:
        print("Unexpected exception: {} for event {}".format(str(e), event))
Exemplo n.º 2
0
def lambda_handler(event, context):  # pragma: no cover
    for i in range(0, 10):
        lambda_metric("lambda_custom_metric",i, tags=['owner:temp', 'env:demo'])
    log(metric_name='requests', tags=['hash-service'])
    return LambdaHandler.lambda_handler(event, context)
Exemplo n.º 3
0
 def wrapped_function_2():
     wrapped_function_1()
     lambda_metric("lambda.dist.2", 30)
Exemplo n.º 4
0
 def wrapped_function_1():
     lambda_metric("lambda.dist.1", 10)
Exemplo n.º 5
0
 def basic_wrapped_function():
     lambda_metric("lambda.somemetric", 100)
Exemplo n.º 6
0
def increment(metric):
    lambda_metric("airqualitybot.{}".format(metric), 1)
def wrapped_function(id):
    lambda_metric("dist_" + str(id), 42)
    # sleep makes the os continue another thread
    time.sleep(0.001)

    lambda_metric("common_dist", 42)