Skip to content

Commit

Permalink
Update manual sample app with OTel Python propagator package (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN authored Oct 12, 2021
1 parent f7374ac commit a491470
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ following links.
- [OpenTelemetry Python Core GitHub](https://github.com/open-telemetry/opentelemetry-python)
- [OpenTelemetry Python Contrib GitHub](https://github.com/open-telemetry/opentelemetry-python-contrib)
- [AWS OpenTelemetry Python SDK Extension Package](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/sdk-extension/opentelemetry-sdk-extension-aws)
- [AWS OpenTelemetry Python X-Ray Propagator Package](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/propagator/opentelemetry-propagator-aws-xray)
- [AWS Distro for OpenTelemetry](https://aws-otel.github.io/)

## Security
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor

# AWS X-Ray Propagator Components

from opentelemetry.propagators.aws import AwsXRayPropagator

# AWS X-Ray SDK Extension Components

from opentelemetry.sdk.extension.aws.trace import AwsXRayIdGenerator
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import (
AwsXRayFormat,
)
# from opentelemetry.sdk.resources import get_aggregated_resources
# from opentelemetry.sdk.extension.aws.resource.ec2 import (
# AwsEc2ResourceDetector,
Expand All @@ -37,7 +38,7 @@
# Setup AWS X-Ray Propagator

# Propagators can be set using environment variable: OTEL_PROPAGATORS = xray
propagate.set_global_textmap(AwsXRayFormat())
propagate.set_global_textmap(AwsXRayPropagator())

# Setup Tracer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from flask import Flask, session
import logging
from opentelemetry import trace
from opentelemetry.sdk.extension.aws.trace.propagation.aws_xray_format import (
from opentelemetry.aws.propagators.aws_xray_propagator import (
TRACE_ID_DELIMITER,
TRACE_ID_FIRST_PART_LENGTH,
TRACE_ID_VERSION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ flask
./opentelemetry-python-core/exporter/opentelemetry-exporter-otlp-proto-grpc
./opentelemetry-python-core/exporter/opentelemetry-exporter-otlp
./opentelemetry-python-contrib/sdk-extension/opentelemetry-sdk-extension-aws
./opentelemetry-python-contrib/propagator/opentelemetry-propagator-aws-xray
./opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-botocore
./opentelemetry-python-contrib/util/opentelemetry-util-http
./opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests
Expand Down

0 comments on commit a491470

Please sign in to comment.