diff --git a/.vscode/settings.json b/.vscode/settings.json index db92ccf3..e58c4de2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,7 @@ { "python.pythonPath": "/usr/local/bin/python3", - "python.formatting.provider": "black" + "python.formatting.provider": "black", + "python.testing.unittestArgs": ["-v", "-s", "./tests", "-p", "test*.py"], + "python.testing.pytestEnabled": false, + "python.testing.unittestEnabled": true } diff --git a/datadog_lambda/constants.py b/datadog_lambda/constants.py index 9bd49ce3..acc6a75c 100644 --- a/datadog_lambda/constants.py +++ b/datadog_lambda/constants.py @@ -42,3 +42,8 @@ class XrayDaemon(object): XRAY_TRACE_ID_HEADER_NAME = "_X_AMZN_TRACE_ID" XRAY_DAEMON_ADDRESS = "AWS_XRAY_DAEMON_ADDRESS" FUNCTION_NAME_HEADER_NAME = "AWS_LAMBDA_FUNCTION_NAME" + + +class OtherConsts(object): + parentSpanFinishTimeHeader = "x-datadog-parent-span-finish-time" + originalAuthorizerRequestEpoch = "x-datadog-original-epoch" diff --git a/datadog_lambda/tracing.py b/datadog_lambda/tracing.py index d0136e93..0d3c8ff1 100644 --- a/datadog_lambda/tracing.py +++ b/datadog_lambda/tracing.py @@ -8,6 +8,7 @@ import json import base64 from datetime import datetime, timezone +import traceback from typing import Optional, Dict from datadog_lambda.metric import submit_errors_metric @@ -23,16 +24,18 @@ TraceHeader, TraceContextSource, XrayDaemon, + OtherConsts, ) from datadog_lambda.xray import ( send_segment, parse_xray_header, ) -from ddtrace import tracer, patch +from ddtrace import tracer, patch, Span from ddtrace import __version__ as ddtrace_version from ddtrace.propagation.http import HTTPPropagator from datadog_lambda import __version__ as datadog_lambda_version from datadog_lambda.trigger import ( + _EventSource, parse_event_source, get_first_record, EventTypes, @@ -167,13 +170,29 @@ def extract_context_from_lambda_context(lambda_context): return trace_id, parent_id, sampling_priority -def extract_context_from_http_event_or_context(event, lambda_context): +def extract_context_from_http_event_or_context( + event, lambda_context, event_source: _EventSource +): """ Extract Datadog trace context from the `headers` key in from the Lambda `event` object. Falls back to lambda context if no trace data is found in the `headers` """ + injected_authorizer_data = get_injected_authorizer_data(event, event_source) + if injected_authorizer_data: + try: + # fail fast on any KeyError here + trace_id = injected_authorizer_data[TraceHeader.TRACE_ID] + parent_id = injected_authorizer_data[TraceHeader.PARENT_ID] + sampling_priority = injected_authorizer_data[TraceHeader.SAMPLING_PRIORITY] + return trace_id, parent_id, sampling_priority + except Exception as e: + logger.debug( + "extract_context_from_authorizer_event returned with error. \ + Continue without injecting the authorizer span %s", + e, + ) headers = event.get("headers", {}) lowercase_headers = {k.lower(): v for k, v in headers.items()} @@ -317,6 +336,42 @@ def extract_context_custom_extractor(extractor, event, lambda_context): return None, None, None +def get_injected_authorizer_data(event, event_source: _EventSource) -> dict: + try: + dd_data_raw = None + # has '_datadog' header and not cached because integrationLatency > 0 + authorizer_headers = event.get("requestContext", {}).get("authorizer", {}) + + # [API_GATEWAY V1]if integrationLatency == 0, it's cached and no trace for the authorizer + if ( + event_source.equals( + EventTypes.API_GATEWAY, subtype=EventSubtypes.API_GATEWAY + ) + or event_source.equals( + EventTypes.API_GATEWAY, subtype=EventSubtypes.WEBSOCKET + ) + ) and int(authorizer_headers.get("integrationLatency", 0)) == 0: + return None + + if event_source.equals(EventTypes.API_GATEWAY, subtype=EventSubtypes.HTTP_API): + dd_data_raw = authorizer_headers.get("lambda", {}).get("_datadog") + dd_data = json.loads(base64.b64decode(dd_data_raw)) + # [API_GATEWAY V2]if original authorizer request epoch is different, then it's cached + if event.get("requestContext", {}).get("timeEpoch") == dd_data.get( + OtherConsts.originalAuthorizerRequestEpoch + ): + return dd_data + else: + return None + else: + dd_data_raw = authorizer_headers.get("_datadog") + return json.loads(dd_data_raw) + + except Exception as e: + logger.debug("Failed to check if invocated by an authorizer. error %s", e) + return None + + def extract_dd_trace_context(event, lambda_context, extractor=None): """ Extract Datadog trace context from the Lambda `event` object. @@ -339,7 +394,9 @@ def extract_dd_trace_context(event, lambda_context, extractor=None): trace_id, parent_id, sampling_priority, - ) = extract_context_from_http_event_or_context(event, lambda_context) + ) = extract_context_from_http_event_or_context( + event, lambda_context, event_source + ) elif event_source.equals(EventTypes.SNS) or event_source.equals(EventTypes.SQS): ( trace_id, @@ -379,7 +436,7 @@ def extract_dd_trace_context(event, lambda_context, extractor=None): if dd_trace_context: trace_context_source = TraceContextSource.XRAY logger.debug("extracted dd trace context %s", dd_trace_context) - return dd_trace_context, trace_context_source + return dd_trace_context, trace_context_source, event_source def get_dd_trace_context(): @@ -502,8 +559,9 @@ def set_dd_trace_py_root(trace_context_source, merge_xray_traces): ) -def create_inferred_span(event, context): - event_source = parse_event_source(event) +def create_inferred_span(event, context, event_source: _EventSource = None): + if event_source is None: + event_source = parse_event_source(event) try: if event_source.equals( EventTypes.API_GATEWAY, subtype=EventSubtypes.API_GATEWAY @@ -543,7 +601,7 @@ def create_inferred_span(event, context): return create_inferred_span_from_eventbridge_event(event, context) except Exception as e: logger.debug( - "Unable to infer span. Detected type: {}. Reason: {}", + "Unable to infer span. Detected type: %s. Reason: %s", event_source.to_string(), e, ) @@ -588,7 +646,34 @@ def is_api_gateway_invocation_async(event): return event.get("headers", {}).get("X-Amz-Invocation-Type") == "Event" +def insert_upstream_authorizer_span( + kwargs_to_start_span, other_tags_for_span, start_time_s, finish_time_s=None +): + """Insert the authorizer span. + Without this: parent span --child-> inferred span + With this insertion: parent span --child-> upstreamAuthorizerSpan --child-> inferred span + + Args: + kwargs_to_start_span (Dict): the same keyword arguments used for the inferred span + other_tags_for_span (Dict): the same tag keyword arguments used for the inferred span + start_time_s (int): the start time of the span in seconds + finish_time_s (int): the finish time of the sapn in seconds + """ + + upstream_authorizer_span = tracer.trace( + "aws.apigateway.authorizer", **kwargs_to_start_span + ) + upstream_authorizer_span.set_tags(other_tags_for_span) + upstream_authorizer_span.set_tag("operation_name", "aws.apigateway.authorizer") + # always sync for the authorizer invocation + InferredSpanInfo.set_tags_to_span(upstream_authorizer_span, synchronicity="sync") + upstream_authorizer_span.start = start_time_s + upstream_authorizer_span.finish(finish_time=finish_time_s) + return upstream_authorizer_span + + def create_inferred_span_from_api_gateway_websocket_event(event, context): + trace_ctx = tracer.current_trace_context() request_context = event.get("requestContext") domain = request_context.get("domainName") endpoint = request_context.get("routeKey") @@ -605,7 +690,7 @@ def create_inferred_span_from_api_gateway_websocket_event(event, context): "event_type": request_context.get("eventType"), "message_direction": request_context.get("messageDirection"), } - request_time_epoch = request_context.get("requestTimeEpoch") + request_time_epoch_s = int(request_context.get("requestTimeEpoch")) / 1000 if is_api_gateway_invocation_async(event): InferredSpanInfo.set_tags(tags, tag_source="self", synchronicity="async") else: @@ -616,14 +701,58 @@ def create_inferred_span_from_api_gateway_websocket_event(event, context): "span_type": "web", } tracer.set_tags({"_dd.origin": "lambda"}) + upstream_authorizer_span = None + finish_time_s = None + injected_authorizer_data = get_injected_authorizer_data( + event, _EventSource(EventTypes.API_GATEWAY, EventSubtypes.WEBSOCKET) + ) + if injected_authorizer_data: + try: + start_time_s = ( + int( + injected_authorizer_data.get(OtherConsts.parentSpanFinishTimeHeader) + ) + / 1000 + ) + finish_time_s = ( + request_time_epoch_s + + ( + int( + request_context.get("authorizer", {}).get( + "integrationLatency", 0 + ) + ) + ) + / 1000 + ) + upstream_authorizer_span = insert_upstream_authorizer_span( + args, tags, start_time_s, finish_time_s + ) + # trace context needs to be set again as it is reset by upstream_authorizer_span.finish + tracer.context_provider.activate(trace_ctx) + except Exception as e: + traceback.print_exc() + logger.debug( + "Unable to insert authorizer span. Continue to generate the main span.\ + Event %s, Reason: %s", + event, + e, + ) + # trace context needs to be set again as it is reset by upstream_authorizer_span.finish + tracer.context_provider.activate(trace_ctx) span = tracer.trace("aws.apigateway.websocket", **args) if span: span.set_tags(tags) - span.start = request_time_epoch / 1000 + span.start = ( + finish_time_s if finish_time_s is not None else request_time_epoch_s + ) + if upstream_authorizer_span: + span.parent_id = upstream_authorizer_span.span_id return span def create_inferred_span_from_api_gateway_event(event, context): + trace_ctx = tracer.current_trace_context() request_context = event.get("requestContext") domain = request_context.get("domainName") method = event.get("httpMethod") @@ -640,7 +769,7 @@ def create_inferred_span_from_api_gateway_event(event, context): "stage": request_context.get("stage"), "request_id": request_context.get("requestId"), } - request_time_epoch = request_context.get("requestTimeEpoch") + request_time_epoch_s = int(request_context.get("requestTimeEpoch")) / 1000 if is_api_gateway_invocation_async(event): InferredSpanInfo.set_tags(tags, tag_source="self", synchronicity="async") else: @@ -651,14 +780,58 @@ def create_inferred_span_from_api_gateway_event(event, context): "span_type": "http", } tracer.set_tags({"_dd.origin": "lambda"}) + upstream_authorizer_span = None + finish_time_s = None + injected_authorizer_data = get_injected_authorizer_data( + event, _EventSource(EventTypes.API_GATEWAY, EventSubtypes.API_GATEWAY) + ) + if injected_authorizer_data: + try: + start_time_s = ( + int( + injected_authorizer_data.get(OtherConsts.parentSpanFinishTimeHeader) + ) + / 1000 + ) + finish_time_s = ( + request_time_epoch_s + + ( + int( + request_context.get("authorizer", {}).get( + "integrationLatency", 0 + ) + ) + ) + / 1000 + ) + upstream_authorizer_span = insert_upstream_authorizer_span( + args, tags, start_time_s, finish_time_s + ) + # trace context needs to be set again as it is reset by upstream_authorizer_span.finish + tracer.context_provider.activate(trace_ctx) + except Exception as e: + traceback.print_exc() + logger.debug( + "Unable to insert authorizer span. Continue to generate the main span. \ + Event %s, Reason: %s", + event, + e, + ) + span = tracer.trace("aws.apigateway", **args) if span: span.set_tags(tags) - span.start = request_time_epoch / 1000 + # start time pushed by the inserted authorizer span + span.start = ( + finish_time_s if finish_time_s is not None else request_time_epoch_s + ) + if upstream_authorizer_span: + span.parent_id = upstream_authorizer_span.span_id return span def create_inferred_span_from_http_api_event(event, context): + trace_ctx = tracer.current_trace_context() request_context = event.get("requestContext") domain = request_context.get("domainName") method = request_context.get("http", {}).get("method") @@ -678,7 +851,7 @@ def create_inferred_span_from_http_api_event(event, context): "apiname": request_context.get("apiId"), "stage": request_context.get("stage"), } - request_time_epoch = request_context.get("timeEpoch") + request_time_epoch_s = int(request_context.get("timeEpoch")) / 1000 if is_api_gateway_invocation_async(event): InferredSpanInfo.set_tags(tags, tag_source="self", synchronicity="async") else: @@ -689,10 +862,41 @@ def create_inferred_span_from_http_api_event(event, context): "span_type": "http", } tracer.set_tags({"_dd.origin": "lambda"}) + upstream_authorizer_span = None + finish_time_s = None + injected_authorizer_data = get_injected_authorizer_data( + event, _EventSource(EventTypes.API_GATEWAY, EventSubtypes.HTTP_API) + ) + if injected_authorizer_data: + try: + start_time_s = ( + int( + injected_authorizer_data.get(OtherConsts.parentSpanFinishTimeHeader) + ) + / 1000 + ) + finish_time_s = start_time_s # no integrationLatency info in this case + upstream_authorizer_span = insert_upstream_authorizer_span( + args, tags, start_time_s, finish_time_s + ) + # trace context needs to be set again as it is reset by upstream_authorizer_span.finish + tracer.context_provider.activate(trace_ctx) + except Exception as e: + traceback.print_exc() + logger.debug( + "Unable to insert authorizer span. \ + Continue to generate the main span. Event %s, Reason: %s", + event, + e, + ) span = tracer.trace("aws.httpapi", **args) if span: span.set_tags(tags) - span.start = request_time_epoch / 1000 + span.start = ( + finish_time_s if finish_time_s is not None else request_time_epoch_s + ) + if upstream_authorizer_span: + span.parent_id = upstream_authorizer_span.span_id return span @@ -973,14 +1177,39 @@ class InferredSpanInfo(object): SYNCHRONICITY = f"{BASE_NAME}.synchronicity" TAG_SOURCE = f"{BASE_NAME}.tag_source" - @classmethod + @staticmethod def set_tags( - cls, tags: Dict[str, str], synchronicity: Optional[Literal["sync", "async"]] = None, tag_source: Optional[Literal["labmda", "self"]] = None, ): if synchronicity is not None: - tags[cls.SYNCHRONICITY] = str(synchronicity) + tags[InferredSpanInfo.SYNCHRONICITY] = str(synchronicity) + if tag_source is not None: + tags[InferredSpanInfo.TAG_SOURCE] = str(tag_source) + + @staticmethod + def set_tags_to_span( + span: Span, + synchronicity: Optional[Literal["sync", "async"]] = None, + tag_source: Optional[Literal["labmda", "self"]] = None, + ): + if synchronicity is not None: + span.set_tags({InferredSpanInfo.SYNCHRONICITY: synchronicity}) if tag_source is not None: - tags[cls.TAG_SOURCE] = str(tag_source) + span.set_tags({InferredSpanInfo.TAG_SOURCE: str(tag_source)}) + + @staticmethod + def is_async(span: Span) -> bool: + if not span: + return False + try: + return span.get_tag(InferredSpanInfo.SYNCHRONICITY) == "async" + except Exception as e: + logger.debug( + "Unabled to read the %s tag, returning False. \ + Reason: %s.", + InferredSpanInfo.SYNCHRONICITY, + e, + ) + return False diff --git a/datadog_lambda/wrapper.py b/datadog_lambda/wrapper.py index 88508ab3..02d2485c 100644 --- a/datadog_lambda/wrapper.py +++ b/datadog_lambda/wrapper.py @@ -3,16 +3,21 @@ # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019 Datadog, Inc. +import base64 import os import logging import traceback from importlib import import_module +import json +from time import time_ns +from ddtrace.propagation.http import HTTPPropagator from datadog_lambda.extension import should_use_extension, flush_extension from datadog_lambda.cold_start import set_cold_start, is_cold_start from datadog_lambda.constants import ( TraceContextSource, XraySubsegment, + OtherConsts, ) from datadog_lambda.metric import ( flush_stats, @@ -33,7 +38,12 @@ create_inferred_span, InferredSpanInfo, ) -from datadog_lambda.trigger import extract_trigger_tags, extract_http_status_code_tag +from datadog_lambda.trigger import ( + extract_trigger_tags, + extract_http_status_code_tag, + EventTypes, + EventSubtypes, +) from datadog_lambda.tag_object import tag_object profiling_env_var = os.environ.get("DD_PROFILING_ENABLED", "false").lower() == "true" @@ -116,6 +126,9 @@ def __init__(self, func): self.make_inferred_span = ( os.environ.get("DD_TRACE_MANAGED_SERVICES", "true").lower() == "true" ) + self.make_authorizer_span = ( + os.environ.get("DD_LINK_LAMBDA_AUTHORIZER", "true").lower() == "true" + ) self.response = None if profiling_env_var: self.prof = profiler.Profiler(env=env_env_var, service=service_env_var) @@ -148,6 +161,7 @@ def __call__(self, event, context, **kwargs): self._before(event, context) try: self.response = self.func(event, context, **kwargs) + self._ending(event) return self.response except Exception: submit_errors_metric(context) @@ -157,6 +171,32 @@ def __call__(self, event, context, **kwargs): finally: self._after(event, context) + def _inject_authorizer_span_headers(self, event): + finish_time_ns = ( + self.span.start_ns + if InferredSpanInfo.is_async(self.inferred_span) and self.span + else time_ns() + ) + injected_headers = {} + source_span = self.inferred_span if self.inferred_span else self.span + HTTPPropagator.inject(source_span.context, injected_headers) + injected_headers[OtherConsts.parentSpanFinishTimeHeader] = finish_time_ns / 1e6 + encode_datadog_data = False + if self.event_source and self.event_source.equals( + EventTypes.API_GATEWAY, EventSubtypes.HTTP_API + ): + injected_headers[OtherConsts.originalAuthorizerRequestEpoch] = event.get( + "requestContext", {} + ).get("timeEpoch") + encode_datadog_data = True + datadog_data = json.dumps(injected_headers).encode() + if encode_datadog_data: + datadog_data = base64.b64encode( + datadog_data + ) # special characters can corrupt the response + self.response.setdefault("context", {}) + self.response["context"]["_datadog"] = datadog_data + def _before(self, event, context): try: self.response = None @@ -164,9 +204,10 @@ def _before(self, event, context): submit_invocations_metric(context) self.trigger_tags = extract_trigger_tags(event, context) # Extract Datadog trace context and source from incoming requests - dd_context, trace_context_source = extract_dd_trace_context( + dd_context, trace_context_source, event_source = extract_dd_trace_context( event, context, extractor=self.trace_extractor ) + self.event_source = event_source # Create a Datadog X-Ray subsegment with the trace context if dd_context and trace_context_source == TraceContextSource.EVENT: create_dd_dummy_metadata_subsegment( @@ -176,7 +217,9 @@ def _before(self, event, context): if dd_tracing_enabled: set_dd_trace_py_root(trace_context_source, self.merge_xray_traces) if self.make_inferred_span: - self.inferred_span = create_inferred_span(event, context) + self.inferred_span = create_inferred_span( + event, context, event_source + ) self.span = create_function_execution_span( context, self.function_name, @@ -194,6 +237,19 @@ def _before(self, event, context): except Exception: traceback.print_exc() + def _ending(self, event): + try: + if ( + self.make_authorizer_span + and self.response + and self.response.get("principalId") + and self.response.get("policyDocument") + and self.event_source + ): + self._inject_authorizer_span_headers(event) + except Exception: + traceback.print_exc() + def _after(self, event, context): try: status_code = extract_http_status_code_tag(self.trigger_tags, self.response) @@ -221,11 +277,7 @@ def _after(self, event, context): if status_code: self.inferred_span.set_tag("http.status_code", status_code) - if ( - self.inferred_span.get_tag(InferredSpanInfo.SYNCHRONICITY) - == "async" - and self.span - ): + if InferredSpanInfo.is_async(self.inferred_span) and self.span: self.inferred_span.finish(finish_time=self.span.start) else: self.inferred_span.finish() diff --git a/scripts/run_integration_tests.sh b/scripts/run_integration_tests.sh index 895a9e50..e62eefd3 100755 --- a/scripts/run_integration_tests.sh +++ b/scripts/run_integration_tests.sh @@ -194,11 +194,13 @@ for handler_name in "${LAMBDA_HANDLERS[@]}"; do # Normalize package version so that these snapshots aren't broken on version bumps sed -E "s/(dd_lambda_layer:datadog-python[0-9]+_)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | sed -E "s/(datadog_lambda:v)([0-9]+\.[0-9]+\.[0-9])/\1XX/g" | + sed -E "s/(datadogpy\/)([0-9]+\.[0-9]+\.[0-9])/\1XX/g" | sed -E "s/(python )([0-9]\.[0-9]+\.[0-9]+)/\1XX/g" | # Strip out run ID (from function name, resource, etc.) sed -E "s/${!run_id}/XXXX/g" | # Normalize python-requests version sed -E "s/(User-Agent:python-requests\/)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | + sed -E "s/(\"http.useragent\"\: \"python-requests\/)[0-9]+\.[0-9]+\.[0-9]+/\1X\.X\.X/g" | # Strip out trace/span/parent/timestamps sed -E "s/(\"trace_id\"\: \")[A-Z0-9\.\-]+/\1XXXX/g" | sed -E "s/(\"span_id\"\: \")[A-Z0-9\.\-]+/\1XXXX/g" | diff --git a/tests/event_samples/authorizer-request-api-gateway-v1.json b/tests/event_samples/authorizer-request-api-gateway-v1.json new file mode 100644 index 00000000..16dfbd2a --- /dev/null +++ b/tests/event_samples/authorizer-request-api-gateway-v1.json @@ -0,0 +1,93 @@ +{ + "resource": "/hello", + "path": "/hello", + "httpMethod": "GET", + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Authorization": "secretT0k3n", + "authorizationToken": "secretT0k3n", + "Cache-Control": "no-cache", + "CloudFront-Forwarded-Proto": "https", + "CloudFront-Is-Desktop-Viewer": "true", + "CloudFront-Is-Mobile-Viewer": "false", + "CloudFront-Is-SmartTV-Viewer": "false", + "CloudFront-Is-Tablet-Viewer": "false", + "CloudFront-Viewer-ASN": "12271", + "CloudFront-Viewer-Country": "US", + "Host": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "Postman-Token": "75a5e2b0-d8e8-4370-ad2c-7209761c3f43", + "User-Agent": "PostmanRuntime/7.29.2", + "Via": "1.1 ed4584f7c263c11cf4adf75ba3a25764.cloudfront.net (CloudFront)", + "X-Amz-Cf-Id": "wbruuv68N6jFldH7oUaE9kWABzHsvPi3zzByABVGXCVsnGYOhcRjow==", + "X-Amzn-Trace-Id": "Root=1-6323de2b-0155211e49422a532809a10e", + "X-Forwarded-For": "24.193.182.233, 15.158.35.8", + "X-Forwarded-Port": "443", + "X-Forwarded-Proto": "https" + }, + "multiValueHeaders": { + "Accept": ["*/*"], + "Accept-Encoding": ["gzip, deflate, br"], + "Authorization": ["secretT0k3n"], + "authorizationToken": ["secretT0k3n"], + "Cache-Control": ["no-cache"], + "CloudFront-Forwarded-Proto": ["https"], + "CloudFront-Is-Desktop-Viewer": ["true"], + "CloudFront-Is-Mobile-Viewer": ["false"], + "CloudFront-Is-SmartTV-Viewer": ["false"], + "CloudFront-Is-Tablet-Viewer": ["false"], + "CloudFront-Viewer-ASN": ["12271"], + "CloudFront-Viewer-Country": ["US"], + "Host": ["amddr1rix9.execute-api.sa-east-1.amazonaws.com"], + "Postman-Token": ["75a5e2b0-d8e8-4370-ad2c-7209761c3f43"], + "User-Agent": ["PostmanRuntime/7.29.2"], + "Via": ["1.1 ed4584f7c263c11cf4adf75ba3a25764.cloudfront.net (CloudFront)"], + "X-Amz-Cf-Id": ["wbruuv68N6jFldH7oUaE9kWABzHsvPi3zzByABVGXCVsnGYOhcRjow=="], + "X-Amzn-Trace-Id": ["Root=1-6323de2b-0155211e49422a532809a10e"], + "X-Forwarded-For": ["24.193.182.233, 15.158.35.8"], + "X-Forwarded-Port": ["443"], + "X-Forwarded-Proto": ["https"] + }, + "queryStringParameters": null, + "multiValueQueryStringParameters": null, + "pathParameters": null, + "stageVariables": null, + "requestContext": { + "resourceId": "0et54l", + "authorizer": { + "_datadog": "{\"x-datadog-trace-id\": \"13478705995797221209\", \"x-datadog-parent-id\": \"8471288263384216896\", \"x-datadog-sampling-priority\": \"1\", \"x-datadog-tags\": \"_dd.p.dm=-0\", \"x-datadog-parent-span-finish-time\": 1663295021827.521}", + "scope": "this is just a string", + "principalId": "foo", + "integrationLatency": 1897 + }, + "resourcePath": "/hello", + "httpMethod": "GET", + "extendedRequestId": "Yh-m5G_wGjQFftQ=", + "requestTime": "16/Sep/2022:02:23:39 +0000", + "path": "/dev/hello", + "accountId": "601427279990", + "protocol": "HTTP/1.1", + "stage": "dev", + "domainPrefix": "amddr1rix9", + "requestTimeEpoch": 1663295019935, + "requestId": "1234567", + "identity": { + "cognitoIdentityPoolId": null, + "accountId": null, + "cognitoIdentityId": null, + "caller": null, + "sourceIp": "24.193.182.233", + "principalOrgId": null, + "accessKey": null, + "cognitoAuthenticationType": null, + "cognitoAuthenticationProvider": null, + "userArn": null, + "userAgent": "PostmanRuntime/7.29.2", + "user": null + }, + "domainName": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "apiId": "amddr1rix9" + }, + "body": null, + "isBase64Encoded": false +} diff --git a/tests/event_samples/authorizer-request-api-gateway-v2.json b/tests/event_samples/authorizer-request-api-gateway-v2.json new file mode 100644 index 00000000..ac11c6ed --- /dev/null +++ b/tests/event_samples/authorizer-request-api-gateway-v2.json @@ -0,0 +1,47 @@ +{ + "version": "2.0", + "routeKey": "GET /hello", + "rawPath": "/hello", + "rawQueryString": "", + "headers": { + "accept": "*/*", + "accept-encoding": "gzip, deflate, br", + "authorization": "secretT0k3n", + "authorizationtoken": "secretT0k3n", + "cache-control": "no-cache", + "content-length": "0", + "host": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "postman-token": "5e0efdb2-d93f-4d44-8792-45404d40dae2", + "user": "12345", + "user-agent": "curl/7.64.1", + "x-amzn-trace-id": "Root=1-63321d1e-6b80ef0d2c2cf49600b9c28e", + "x-forwarded-for": "38.122.226.210", + "x-forwarded-port": "443", + "x-forwarded-proto": "https" + }, + "requestContext": { + "accountId": "601427279990", + "apiId": "amddr1rix9", + "authorizer": { + "lambda": { + "_datadog": "eyJ4LWRhdGFkb2ctdHJhY2UtaWQiOiAiMTQzNTY5ODM2MTk4NTI5MzMzNTQiLCAieC1kYXRhZG9nLXBhcmVudC1pZCI6ICIxMjY1ODYyMTA4MzUwNTQxMzgwOSIsICJ4LWRhdGFkb2ctc2FtcGxpbmctcHJpb3JpdHkiOiAiMSIsICJ4LWRhdGFkb2ctdGFncyI6ICJfZGQucC5kbT0tMCIsICJ4LWRhdGFkb2ctcGFyZW50LXNwYW4tZmluaXNoLXRpbWUiOiAxNjY0MjI4NjM5NTMzLjc3NTQsICJ4LWRhdGFkb2ctb3JpZ2luYWwtZXBvY2giOiAxNjY0MjI4NjM4MDg0fQ==", + "scope": "this is just a string" + } + }, + "domainName": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "domainPrefix": "amddr1rix9", + "http": { + "method": "GET", + "path": "/hello", + "protocol": "HTTP/1.1", + "sourceIp": "38.122.226.210", + "userAgent": "curl/7.64.1" + }, + "requestId": "1234567", + "routeKey": "GET /hello", + "stage": "dev", + "time": "26/Sep/2022:21:43:58 +0000", + "timeEpoch": 1664228638084 + }, + "isBase64Encoded": false +} diff --git a/tests/event_samples/authorizer-request-api-gateway-websocket-connect.json b/tests/event_samples/authorizer-request-api-gateway-websocket-connect.json new file mode 100644 index 00000000..a325a3f7 --- /dev/null +++ b/tests/event_samples/authorizer-request-api-gateway-websocket-connect.json @@ -0,0 +1,48 @@ +{ + "headers": { + "Auth": "secretT0k3n", + "Host": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits", + "Sec-WebSocket-Key": "j9g8xXvniFqyyA+34vQ/Lg==", + "Sec-WebSocket-Version": "13", + "X-Amzn-Trace-Id": "Root=1-63348d21-727f66307696916d50f93f1b", + "X-Forwarded-For": "38.122.226.210", + "X-Forwarded-Port": "443", + "X-Forwarded-Proto": "https" + }, + "multiValueHeaders": { + "Auth": ["secretT0k3n"], + "Host": ["amddr1rix9.execute-api.sa-east-1.amazonaws.com"], + "Sec-WebSocket-Extensions": ["permessage-deflate; client_max_window_bits"], + "Sec-WebSocket-Key": ["j9g8xXvniFqyyA+34vQ/Lg=="], + "Sec-WebSocket-Version": ["13"], + "X-Amzn-Trace-Id": ["Root=1-63348d21-727f66307696916d50f93f1b"], + "X-Forwarded-For": ["38.122.226.210"], + "X-Forwarded-Port": ["443"], + "X-Forwarded-Proto": ["https"] + }, + "requestContext": { + "routeKey": "$connect", + "authorizer": { + "_datadog": "{\"x-datadog-trace-id\": \"5351047404834723189\", \"x-datadog-parent-id\": \"18230460631156161837\", \"x-datadog-sampling-priority\": \"1\", \"x-datadog-tags\": \"_dd.p.dm=-0\", \"x-datadog-parent-span-finish-time\": 1664388386890}", + "scope": "this is just a string", + "principalId": "foo", + "integrationLatency": 1440 + }, + "eventType": "CONNECT", + "extendedRequestId": "1234567", + "requestTime": "28/Sep/2022:18:06:25 +0000", + "messageDirection": "IN", + "stage": "dev", + "connectedAt": 1664388385450, + "requestTimeEpoch": 1664388385452, + "identity": { + "sourceIp": "38.122.226.210" + }, + "requestId": "1234567", + "domainName": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "connectionId": "ZLr9QeNLmjQCIZA=", + "apiId": "amddr1rix9" + }, + "isBase64Encoded": false +} diff --git a/tests/event_samples/authorizer-request-api-gateway-websocket-main.json b/tests/event_samples/authorizer-request-api-gateway-websocket-main.json new file mode 100644 index 00000000..0cda1a6e --- /dev/null +++ b/tests/event_samples/authorizer-request-api-gateway-websocket-main.json @@ -0,0 +1,27 @@ +{ + "requestContext": { + "routeKey": "main", + "authorizer": { + "_datadog": "{\"x-datadog-trace-id\": \"17374069065025434920\", \"x-datadog-parent-id\": \"7915186751914176106\", \"x-datadog-sampling-priority\": \"1\", \"x-datadog-tags\": \"_dd.p.dm=-0\", \"x-datadog-parent-span-finish-time\": 1664390333526.5068}", + "scope": "this is just a string", + "principalId": "foo" + }, + "messageId": "ZLw3leP1GjQCI8Q=", + "eventType": "MESSAGE", + "extendedRequestId": "ZLw3lFowmjQFvSA=", + "requestTime": "28/Sep/2022:18:39:57 +0000", + "messageDirection": "IN", + "stage": "dev", + "connectedAt": 1664390332261, + "requestTimeEpoch": 1664390397117, + "identity": { + "sourceIp": "38.122.226.210" + }, + "requestId": "1234567", + "domainName": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "connectionId": "ZLwtceO1mjQCI8Q=", + "apiId": "amddr1rix9" + }, + "body": "{\n \"action\":\"main\",\n \"message\":\"hi\"\n}", + "isBase64Encoded": false +} diff --git a/tests/event_samples/authorizer-token-api-gateway-v1.json b/tests/event_samples/authorizer-token-api-gateway-v1.json new file mode 100644 index 00000000..0c28772a --- /dev/null +++ b/tests/event_samples/authorizer-token-api-gateway-v1.json @@ -0,0 +1,93 @@ +{ + "resource": "/hello", + "path": "/hello", + "httpMethod": "GET", + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Authorization": "secretT0k3n", + "authorizationToken": "secretT0k3n", + "Cache-Control": "no-cache", + "CloudFront-Forwarded-Proto": "https", + "CloudFront-Is-Desktop-Viewer": "true", + "CloudFront-Is-Mobile-Viewer": "false", + "CloudFront-Is-SmartTV-Viewer": "false", + "CloudFront-Is-Tablet-Viewer": "false", + "CloudFront-Viewer-ASN": "174", + "CloudFront-Viewer-Country": "US", + "Host": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "Postman-Token": "791b2f79-1732-4877-abc1-5c538daf4642", + "User-Agent": "PostmanRuntime/7.29.2", + "Via": "1.1 d58463d219ef6ca0331e7200a6667c18.cloudfront.net (CloudFront)", + "X-Amz-Cf-Id": "tqU0SVyX_dKKI0XIN4-kwzCHrROBFECLXtAKCtjKr1uRQ-uijj99sQ==", + "X-Amzn-Trace-Id": "Root=1-632b4732-3e69c6a34f21f00d7f9b5599", + "X-Forwarded-For": "38.122.226.210, 64.252.135.71", + "X-Forwarded-Port": "443", + "X-Forwarded-Proto": "https" + }, + "multiValueHeaders": { + "Accept": ["*/*"], + "Accept-Encoding": ["gzip, deflate, br"], + "Authorization": ["secretT0k3n"], + "authorizationToken": ["secretT0k3n"], + "Cache-Control": ["no-cache"], + "CloudFront-Forwarded-Proto": ["https"], + "CloudFront-Is-Desktop-Viewer": ["true"], + "CloudFront-Is-Mobile-Viewer": ["false"], + "CloudFront-Is-SmartTV-Viewer": ["false"], + "CloudFront-Is-Tablet-Viewer": ["false"], + "CloudFront-Viewer-ASN": ["174"], + "CloudFront-Viewer-Country": ["US"], + "Host": ["amddr1rix9.execute-api.sa-east-1.amazonaws.com"], + "Postman-Token": ["791b2f79-1732-4877-abc1-5c538daf4642"], + "User-Agent": ["PostmanRuntime/7.29.2"], + "Via": ["1.1 d58463d219ef6ca0331e7200a6667c18.cloudfront.net (CloudFront)"], + "X-Amz-Cf-Id": ["tqU0SVyX_dKKI0XIN4-kwzCHrROBFECLXtAKCtjKr1uRQ-uijj99sQ=="], + "X-Amzn-Trace-Id": ["Root=1-632b4732-3e69c6a34f21f00d7f9b5599"], + "X-Forwarded-For": ["38.122.226.210, 64.252.135.71"], + "X-Forwarded-Port": ["443"], + "X-Forwarded-Proto": ["https"] + }, + "queryStringParameters": null, + "multiValueQueryStringParameters": null, + "pathParameters": null, + "stageVariables": null, + "requestContext": { + "resourceId": "elem3u", + "authorizer": { + "_datadog": "{\"x-datadog-trace-id\": \"17874798268144902712\", \"x-datadog-parent-id\": \"16184667399315372101\", \"x-datadog-sampling-priority\": \"1\", \"x-datadog-tags\": \"_dd.p.dm=-0\", \"x-datadog-parent-span-finish-time\": 1663721602440.8286}", + "scope": "this is just a string", + "principalId": "foo", + "integrationLatency": 1897 + }, + "resourcePath": "/hello", + "httpMethod": "GET", + "extendedRequestId": "Y0gP8FG9mjQFZTQ=", + "requestTime": "21/Sep/2022:17:17:38 +0000", + "path": "/dev/hello", + "accountId": "601427279990", + "protocol": "HTTP/1.1", + "stage": "dev", + "domainPrefix": "amddr1rix9", + "requestTimeEpoch": 1663295019935, + "requestId": "1234567", + "identity": { + "cognitoIdentityPoolId": null, + "accountId": null, + "cognitoIdentityId": null, + "caller": null, + "sourceIp": "38.122.226.210", + "principalOrgId": null, + "accessKey": null, + "cognitoAuthenticationType": null, + "cognitoAuthenticationProvider": null, + "userArn": null, + "userAgent": "PostmanRuntime/7.29.2", + "user": null + }, + "domainName": "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + "apiId": "amddr1rix9" + }, + "body": null, + "isBase64Encoded": false +} diff --git a/tests/integration/snapshots/logs/async-metrics_python37.log b/tests/integration/snapshots/logs/async-metrics_python37.log index 206525fb..602708d8 100644 --- a/tests/integration/snapshots/logs/async-metrics_python37.log +++ b/tests/integration/snapshots/logs/async-metrics_python37.log @@ -122,7 +122,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -143,7 +144,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -273,7 +275,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -294,7 +297,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -417,7 +421,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -438,7 +443,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -576,7 +582,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -597,7 +604,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -727,7 +735,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -748,7 +757,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -875,7 +885,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -896,7 +907,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1024,7 +1036,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1045,7 +1058,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1172,7 +1186,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1193,7 +1208,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1328,7 +1344,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1349,7 +1366,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 diff --git a/tests/integration/snapshots/logs/async-metrics_python38.log b/tests/integration/snapshots/logs/async-metrics_python38.log index f85c9bdf..0232331c 100644 --- a/tests/integration/snapshots/logs/async-metrics_python38.log +++ b/tests/integration/snapshots/logs/async-metrics_python38.log @@ -122,7 +122,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -143,7 +144,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -273,7 +275,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -294,7 +297,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -417,7 +421,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -438,7 +443,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -576,7 +582,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -597,7 +604,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -727,7 +735,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -748,7 +757,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -875,7 +885,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -896,7 +907,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1024,7 +1036,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1045,7 +1058,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1172,7 +1186,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1193,7 +1208,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1328,7 +1344,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1349,7 +1366,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 diff --git a/tests/integration/snapshots/logs/async-metrics_python39.log b/tests/integration/snapshots/logs/async-metrics_python39.log index 5b070898..cae1234c 100644 --- a/tests/integration/snapshots/logs/async-metrics_python39.log +++ b/tests/integration/snapshots/logs/async-metrics_python39.log @@ -122,7 +122,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -143,7 +144,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -273,7 +275,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -294,7 +297,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -417,7 +421,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -438,7 +443,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -576,7 +582,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -597,7 +604,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -727,7 +735,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -748,7 +757,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -875,7 +885,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -896,7 +907,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1024,7 +1036,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1045,7 +1058,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1172,7 +1186,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1193,7 +1208,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1328,7 +1344,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1349,7 +1366,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 diff --git a/tests/integration/snapshots/logs/sync-metrics_python37.log b/tests/integration/snapshots/logs/sync-metrics_python37.log index 423e6860..d1e74749 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python37.log +++ b/tests/integration/snapshots/logs/sync-metrics_python37.log @@ -102,7 +102,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -123,7 +124,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -133,7 +135,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -153,6 +155,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -267,7 +270,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -288,7 +292,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -298,7 +303,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -318,6 +323,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -425,7 +431,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -446,7 +453,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -456,7 +464,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -476,6 +484,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -598,7 +607,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -619,7 +629,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -629,7 +640,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -649,6 +660,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -763,7 +775,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -784,7 +797,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -794,7 +808,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -814,6 +828,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -925,7 +940,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -946,7 +962,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -956,7 +973,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -976,6 +993,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1088,7 +1106,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1109,7 +1128,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1119,7 +1139,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1139,6 +1159,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1250,7 +1271,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1271,7 +1293,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1281,7 +1304,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1301,6 +1324,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1420,7 +1444,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1441,7 +1466,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1451,7 +1477,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python37_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1471,6 +1497,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { diff --git a/tests/integration/snapshots/logs/sync-metrics_python38.log b/tests/integration/snapshots/logs/sync-metrics_python38.log index cc9c3d08..b611cdb9 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python38.log +++ b/tests/integration/snapshots/logs/sync-metrics_python38.log @@ -102,7 +102,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -123,7 +124,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -133,7 +135,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -153,6 +155,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -267,7 +270,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -288,7 +292,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -298,7 +303,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -318,6 +323,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -425,7 +431,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -446,7 +453,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -456,7 +464,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -476,6 +484,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -598,7 +607,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -619,7 +629,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -629,7 +640,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -649,6 +660,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -763,7 +775,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -784,7 +797,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -794,7 +808,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -814,6 +828,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -925,7 +940,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -946,7 +962,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -956,7 +973,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -976,6 +993,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1088,7 +1106,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1109,7 +1128,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1119,7 +1139,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1139,6 +1159,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1250,7 +1271,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1271,7 +1293,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1281,7 +1304,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1301,6 +1324,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1420,7 +1444,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1441,7 +1466,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1451,7 +1477,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python38_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1471,6 +1497,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { diff --git a/tests/integration/snapshots/logs/sync-metrics_python39.log b/tests/integration/snapshots/logs/sync-metrics_python39.log index 89ee22fd..b202a4fd 100644 --- a/tests/integration/snapshots/logs/sync-metrics_python39.log +++ b/tests/integration/snapshots/logs/sync-metrics_python39.log @@ -102,7 +102,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -123,7 +124,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -133,7 +135,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -153,6 +155,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -267,7 +270,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -288,7 +292,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -298,7 +303,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -318,6 +323,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -425,7 +431,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -446,7 +453,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -456,7 +464,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -476,6 +484,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -598,7 +607,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -619,7 +629,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -629,7 +640,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -649,6 +660,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -763,7 +775,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -784,7 +797,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -794,7 +808,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -814,6 +828,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -925,7 +940,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -946,7 +962,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -956,7 +973,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -976,6 +993,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1088,7 +1106,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1109,7 +1128,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1119,7 +1139,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1139,6 +1159,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1250,7 +1271,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1271,7 +1293,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1281,7 +1304,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1301,6 +1324,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { @@ -1420,7 +1444,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1441,7 +1466,8 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " "_dd.origin": "lambda", "http.method": "GET", "http.url": "https://www.datadoghq.com/", - "http.status_code": "200" + "http.status_code": "200", + "http.useragent": "python-requests/X.X.X" }, "metrics": { "_dd.measured": 1 @@ -1451,7 +1477,7 @@ HTTP GET https://www.datadoghq.com/ Headers: ["Accept-Encoding:gzip, deflate", " ] ] } -HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/0.41.0 (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} +HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Headers: ["Accept-Encoding:gzip, deflate", "Accept:*/*", "Connection:keep-alive", "Content-Encoding:deflate", "Content-Length:XXXX", "Content-Type:application/json", "User-Agent:datadogpy/XX (python XX; os linux; arch x86_64)", "x-datadog-parent-id:XXXX", "x-datadog-sampling-priority:1", "x-datadog-tags:_dd.p.dm=-0", "x-datadog-trace-id:XXXX"] Data: {"series": [{"metric": "hello.dog", "points": [[XXXX, [1.0]]], "type": "distribution", "host": null, "device": null, "tags": ["team:serverless", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}, {"metric": "tests.integration.count", "points": [[XXXX, [21.0]]], "type": "distribution", "host": null, "device": null, "tags": ["test:integration", "role:hello", "dd_lambda_layer:datadog-python39_X.X.X"], "interval": 10}]} { "traces": [ [ @@ -1471,6 +1497,7 @@ HTTP POST https://api.datadoghq.com/api/v1/distribution_points?api_key=XXXX Head "http.method": "POST", "http.url": "https://api.datadoghq.com/api/v1/distribution_points", "http.status_code": "202", + "http.useragent": "datadogpy/XX (python XX; os linux; arch x86_64)", "_dd.p.dm": "-0" }, "metrics": { diff --git a/tests/test_tracing.py b/tests/test_tracing.py index c578de07..4537f630 100644 --- a/tests/test_tracing.py +++ b/tests/test_tracing.py @@ -29,6 +29,7 @@ InferredSpanInfo, extract_context_from_eventbridge_event, ) +from datadog_lambda.trigger import EventTypes function_arn = "arn:aws:lambda:us-west-1:123457598159:function:python-layer-test" @@ -84,7 +85,7 @@ def tearDown(self): def test_without_datadog_trace_headers(self): lambda_ctx = get_mock_context() - ctx, source = extract_dd_trace_context({}, lambda_ctx) + ctx, source, event_source = extract_dd_trace_context({}, lambda_ctx) self.assertEqual(source, "xray") self.assertDictEqual( ctx, @@ -106,7 +107,7 @@ def test_without_datadog_trace_headers(self): def test_with_non_object_event(self): lambda_ctx = get_mock_context() - ctx, source = extract_dd_trace_context(b"", lambda_ctx) + ctx, source, event_source = extract_dd_trace_context(b"", lambda_ctx) self.assertEqual(source, "xray") self.assertDictEqual( ctx, @@ -128,7 +129,7 @@ def test_with_non_object_event(self): def test_with_incomplete_datadog_trace_headers(self): lambda_ctx = get_mock_context() - ctx, source = extract_dd_trace_context( + ctx, source, event_source = extract_dd_trace_context( {"headers": {TraceHeader.TRACE_ID: "123", TraceHeader.PARENT_ID: "321"}}, lambda_ctx, ) @@ -152,7 +153,7 @@ def test_with_incomplete_datadog_trace_headers(self): def test_with_complete_datadog_trace_headers(self): lambda_ctx = get_mock_context() - ctx, source = extract_dd_trace_context( + ctx, source, event_source = extract_dd_trace_context( { "headers": { TraceHeader.TRACE_ID: "123", @@ -193,7 +194,7 @@ def extractor_foo(event, context): return trace_id, parent_id, sampling_priority lambda_ctx = get_mock_context() - ctx, ctx_source = extract_dd_trace_context( + ctx, ctx_source, event_source = extract_dd_trace_context( { "foo": { TraceHeader.TRACE_ID: "123", @@ -227,7 +228,7 @@ def extractor_raiser(event, context): raise Exception("kreator") lambda_ctx = get_mock_context() - ctx, ctx_source = extract_dd_trace_context( + ctx, ctx_source, event_source = extract_dd_trace_context( { "foo": { TraceHeader.TRACE_ID: "123", @@ -289,7 +290,7 @@ def test_with_sqs_distributed_datadog_trace_data(self): } ] } - ctx, source = extract_dd_trace_context(sqs_event, lambda_ctx) + ctx, source, event_source = extract_dd_trace_context(sqs_event, lambda_ctx) self.assertEqual(source, "event") self.assertDictEqual( ctx, @@ -323,7 +324,7 @@ def test_with_legacy_client_context_datadog_trace_data(self): } } ) - ctx, source = extract_dd_trace_context({}, lambda_ctx) + ctx, source, event_source = extract_dd_trace_context({}, lambda_ctx) self.assertEqual(source, "event") self.assertDictEqual( ctx, @@ -356,7 +357,7 @@ def test_with_new_client_context_datadog_trace_data(self): TraceHeader.SAMPLING_PRIORITY: "1", } ) - ctx, source = extract_dd_trace_context({}, lambda_ctx) + ctx, source, event_source = extract_dd_trace_context({}, lambda_ctx) self.assertEqual(source, "event") self.assertDictEqual( ctx, @@ -556,7 +557,7 @@ def test_mixed_parent_context_when_merging(self): # use the dd-trace trace-id and the x-ray parent-id # This allows parenting relationships like dd-trace -> x-ray -> dd-trace lambda_ctx = get_mock_context() - ctx, source = extract_dd_trace_context( + ctx, source, event_type = extract_dd_trace_context( { "headers": { TraceHeader.TRACE_ID: "123", @@ -579,6 +580,109 @@ def test_mixed_parent_context_when_merging(self): self.mock_activate.assert_has_calls([call(expected_context)]) +class TestAuthorizerInferredSpans(unittest.TestCase): + def setUp(self): + patcher = patch("ddtrace.Span.finish", autospec=True) + self.mock_span_stop = patcher.start() + self.addCleanup(patcher.stop) + + def test_create_inferred_span_from_authorizer_request_api_gateway_v1_event(self): + event_sample_source = "authorizer-request-api-gateway-v1" + finish_time = ( + 1663295021.832 # request_time_epoch + integrationLatency for api-gateway-v1 + ) + span = self._authorizer_span_testing_items(event_sample_source, finish_time) + self._basic_common_checks(span, "aws.apigateway.rest") + + def test_create_inferred_span_from_authorizer_token_api_gateway_v1_event(self): + event_sample_source = "authorizer-token-api-gateway-v1" + finish_time = ( + 1663295021.832 # request_time_epoch + integrationLatency for api-gateway-v1 + ) + span = self._authorizer_span_testing_items(event_sample_source, finish_time) + self._basic_common_checks(span, "aws.apigateway.rest") + + def test_create_inferred_span_from_authorizer_request_api_gateway_v2_event(self): + event_sample_source = "authorizer-request-api-gateway-v2" + finish_time = 1664228639.533 # use the injected parent span finish time as an approximation + span = self._authorizer_span_testing_items(event_sample_source, finish_time) + self._basic_common_checks(span, "aws.httpapi") + + def test_create_inferred_span_from_authorizer_request_api_gateway_websocket_connect_event( + self, + ): + event_sample_source = "authorizer-request-api-gateway-websocket-connect" + finish_time = ( + 1664388386.892 # request_time_epoch + integrationLatency in websocket case + ) + span = self._authorizer_span_testing_items(event_sample_source, finish_time) + self._basic_common_checks( + span, "aws.apigateway.websocket", "web", "$connect", None + ) + + def test_create_inferred_span_from_authorizer_request_api_gateway_websocket_main_event( + self, + ): + event_sample_source = "authorizer-request-api-gateway-websocket-main" + test_file = event_samples + event_sample_source + ".json" + with open(test_file, "r") as event: + event = json.load(event) + ctx = get_mock_context() + ctx.aws_request_id = "1234567" + span = create_inferred_span(event, ctx) + self.mock_span_stop.assert_not_called() # NO authorizer span is injected + self._basic_common_checks(span, "aws.apigateway.websocket", "web", "main", None) + + def _authorizer_span_testing_items(self, event_sample_source, finish_time): + test_file = event_samples + event_sample_source + ".json" + with open(test_file, "r") as event: + event = json.load(event) + ctx = get_mock_context() + ctx.aws_request_id = "1234567" + span = create_inferred_span(event, ctx) + self.assertEqual(span.get_tag(InferredSpanInfo.TAG_SOURCE), "self") + self.assertEqual(span.get_tag(InferredSpanInfo.SYNCHRONICITY), "sync") + + # checking the upstream_authorizer_span + self.mock_span_stop.assert_called_once() + args, kwargs = self.mock_span_stop.call_args_list[0] + self.assertEqual(kwargs["finish_time"], finish_time) + self.assertEqual(span.start, finish_time) + authorizer_span = args[0] + self.assertEqual(authorizer_span.name, "aws.apigateway.authorizer") + self.assertEqual(span.parent_id, authorizer_span.span_id) + return span + + def _basic_common_checks( + self, + span, + operation_name, + span_type="http", + route_key="/hello", + http_method="GET", + ): + self.assertEqual(span.get_tag("apiid"), "amddr1rix9") + self.assertEqual(span.get_tag("apiname"), "amddr1rix9") + self.assertEqual(span.get_tag("stage"), "dev") + self.assertEqual(span.get_tag("operation_name"), operation_name) + self.assertEqual(span.span_type, span_type) + self.assertEqual( + span.service, + "amddr1rix9.execute-api.sa-east-1.amazonaws.com", + ) + self.assertEqual( + span.get_tag("http.url"), + "amddr1rix9.execute-api.sa-east-1.amazonaws.com" + route_key, + ) + self.assertEqual(span.get_tag("endpoint"), route_key) + self.assertEqual(span.get_tag("http.method"), http_method) + self.assertEqual( + span.get_tag("resource_names"), + f"{http_method} {route_key}" if http_method else route_key, + ) + self.assertEqual(span.get_tag("request_id"), "1234567") + + class TestInferredSpans(unittest.TestCase): def test_create_inferred_span_from_api_gateway_event(self): event_sample_source = "api-gateway" @@ -1100,7 +1204,7 @@ def test_extract_dd_trace_context_for_eventbridge(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_type = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "12345") self.assertEqual(context["parent-id"], "67890") @@ -1110,7 +1214,7 @@ def test_extract_context_from_sqs_event_with_string_msg_attr(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_type = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "2684756524522091840") self.assertEqual(context["parent-id"], "7431398482019833808") self.assertEqual(context["sampling-priority"], "1") @@ -1121,7 +1225,7 @@ def test_extract_context_from_sqs_batch_event(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "2684756524522091840") self.assertEqual(context["parent-id"], "7431398482019833808") self.assertEqual(context["sampling-priority"], "1") @@ -1132,7 +1236,7 @@ def test_extract_context_from_sns_event_with_string_msg_attr(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "4948377316357291421") self.assertEqual(context["parent-id"], "6746998015037429512") self.assertEqual(context["sampling-priority"], "1") @@ -1143,7 +1247,7 @@ def test_extract_context_from_sns_event_with_b64_msg_attr(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "4948377316357291421") self.assertEqual(context["parent-id"], "6746998015037429512") self.assertEqual(context["sampling-priority"], "1") @@ -1154,7 +1258,7 @@ def test_extract_context_from_sns_batch_event(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "4948377316357291421") self.assertEqual(context["parent-id"], "6746998015037429512") self.assertEqual(context["sampling-priority"], "1") @@ -1165,7 +1269,7 @@ def test_extract_context_from_kinesis_event(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "4948377316357291421") self.assertEqual(context["parent-id"], "2876253380018681026") self.assertEqual(context["sampling-priority"], "1") @@ -1176,7 +1280,7 @@ def test_extract_context_from_kinesis_batch_event(self): with open(test_file, "r") as event: event = json.load(event) ctx = get_mock_context() - context, source = extract_dd_trace_context(event, ctx) + context, source, event_source = extract_dd_trace_context(event, ctx) self.assertEqual(context["trace-id"], "4948377316357291421") self.assertEqual(context["parent-id"], "2876253380018681026") self.assertEqual(context["sampling-priority"], "1") diff --git a/tests/test_wrapper.py b/tests/test_wrapper.py index a78cddfc..6240ec4f 100644 --- a/tests/test_wrapper.py +++ b/tests/test_wrapper.py @@ -38,7 +38,7 @@ def setUp(self): patcher = patch("datadog_lambda.wrapper.extract_dd_trace_context") self.mock_extract_dd_trace_context = patcher.start() - self.mock_extract_dd_trace_context.return_value = ({}, None) + self.mock_extract_dd_trace_context.return_value = ({}, None, None) self.addCleanup(patcher.stop) patcher = patch("datadog_lambda.wrapper.set_correlation_ids")