Skip to content

Commit

Permalink
Rename SMP config to AppSignals (#59)
Browse files Browse the repository at this point in the history
We are renaming the SMP configs:
`OTEL_SMP_ENABLED` -> `OTEL_AWS_APP_SIGNALS_ENABLED`
`OTEL_AWS_SMP_EXPORTER_ENDPOINT` ->
`OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT`

Related PRs:

aws-observability/aws-otel-java-instrumentation#744
aws/amazon-cloudwatch-agent-operator#84


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
srprash authored Feb 15, 2024
2 parents ade69eb + d7ebda2 commit 384b62f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
from opentelemetry.semconv.resource import ResourceAttributes
from opentelemetry.trace import set_tracer_provider

OTEL_SMP_ENABLED = "OTEL_SMP_ENABLED"
OTEL_AWS_APP_SIGNALS_ENABLED = "OTEL_AWS_APP_SIGNALS_ENABLED"
OTEL_METRIC_EXPORT_INTERVAL = "OTEL_METRIC_EXPORT_INTERVAL"
OTEL_AWS_SMP_EXPORTER_ENDPOINT = "OTEL_AWS_SMP_EXPORTER_ENDPOINT"
OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT = "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT"
DEFAULT_METRIC_EXPORT_INTERVAL = 60000.0

_logger: Logger = getLogger(__name__)
Expand All @@ -65,7 +65,7 @@ class AwsOpenTelemetryConfigurator(_OTelSDKConfigurator):
- Add AttributePropagatingSpanProcessor to propagate span attributes from parent to child spans.
- Add AwsMetricAttributesSpanExporter to add more attributes to all spans.
You can control when these customizations are applied using the environment variable OTEL_SMP_ENABLED.
You can control when these customizations are applied using the environment variable OTEL_AWS_APP_SIGNALS_ENABLED.
This flag is disabled by default.
"""

Expand Down Expand Up @@ -169,7 +169,7 @@ def _customize_span_processors(provider: TracerProvider, resource: Resource) ->
]:
temporality_dict[typ] = AggregationTemporality.DELTA
_logger.info("Span Metrics Processor enabled")
smp_endpoint = os.environ.get(OTEL_AWS_SMP_EXPORTER_ENDPOINT, "http://cloudwatch-agent.amazon-cloudwatch:4317")
smp_endpoint = os.environ.get(OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT, "http://localhost:4315")
otel_metric_exporter = OTLPMetricExporter(endpoint=smp_endpoint, preferred_temporality=temporality_dict)
export_interval_millis = float(os.environ.get(OTEL_METRIC_EXPORT_INTERVAL, DEFAULT_METRIC_EXPORT_INTERVAL))
_logger.debug("Span Metrics endpoint: %s", smp_endpoint)
Expand All @@ -189,4 +189,4 @@ def _customize_span_processors(provider: TracerProvider, resource: Resource) ->


def is_smp_enabled():
return os.environ.get(OTEL_SMP_ENABLED, False)
return os.environ.get(OTEL_AWS_APP_SIGNALS_ENABLED, False)
4 changes: 2 additions & 2 deletions contract-tests/tests/test/amazon/base/contract_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def setUp(self) -> None:
DockerContainer(self.get_application_image_name())
.with_exposed_ports(self.get_application_port())
.with_env("OTEL_METRIC_EXPORT_INTERVAL", "100")
.with_env("OTEL_SMP_ENABLED", "true")
.with_env("OTEL_AWS_APP_SIGNALS_ENABLED", "true")
.with_env("OTEL_METRICS_EXPORTER", "none")
.with_env("OTEL_BSP_SCHEDULE_DELAY", "1")
.with_env("OTEL_AWS_SMP_EXPORTER_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}")
.with_env("OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}")
.with_env("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT", f"http://collector:{_MOCK_COLLECTOR_PORT}")
.with_env("OTEL_RESOURCE_ATTRIBUTES", self.get_application_otel_resource_attributes())
.with_env("OTEL_TRACES_SAMPLER", "always_on")
Expand Down

0 comments on commit 384b62f

Please sign in to comment.