File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
aws-opentelemetry-distro/src/amazon/opentelemetry/distro Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22# SPDX-License-Identifier: Apache-2.0
33import logging
4+ import os
45from typing import Dict , Optional , Sequence
56
67import requests
1314from opentelemetry .sdk .trace .export import SpanExportResult
1415
1516AWS_SERVICE = "xray"
17+ AGENT_OBSERVABILITY_ENABLED = os .environ .get ("AGENT_OBSERVABILITY_ENABLED" , "false" )
1618_logger = logging .getLogger (__name__ )
1719
1820
@@ -77,10 +79,13 @@ def __init__(
7779
7880 def export (self , spans : Sequence [ReadableSpan ]) -> SpanExportResult :
7981 # Process spans to handle LLO attributes
80- modified_spans = self ._llo_handler .process_spans (spans )
82+ if AGENT_OBSERVABILITY_ENABLED == "true" :
83+ spans_to_export = self ._llo_handler .process_spans (spans )
84+ else :
85+ spans_to_export = spans
8186
8287 # Export the modified spans
83- return super ().export (modified_spans )
88+ return super ().export (spans_to_export )
8489
8590 # Overrides upstream's private implementation of _export. All behaviors are
8691 # the same except if the endpoint is an XRay OTLP endpoint, we will sign the request
You can’t perform that action at this time.
0 commit comments