Skip to content

Commit

Permalink
fix: outdated classes (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkford authored Aug 22, 2022
1 parent d8c3ab2 commit 8edf143
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/docs/getting-started/python-sdk/trace-manual-instr.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ import json
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor
from opentelemetry.sdk.trace.export import BatchSpanProcessor

# Import the AWS X-Ray for OTel Python IDs Generator into the application.
from opentelemetry.sdk.extension.aws.trace import AwsXRayIdsGenerator
from opentelemetry.sdk.extension.aws.trace import AwsXRayIdGenerator
```

Next, configure the Global Tracer Provider to export to the ADOT Collector. The configuration of your SDK exporter depends on how you wish to connect with your configured ADOT Collector.
Expand All @@ -78,9 +78,9 @@ Connecting to an ADOT Collector running as a sidecar, we can set up the TracerPr
# Sends generated traces in the OTLP format to an ADOT Collector running on port 4317
otlp_exporter = OTLPSpanExporter(endpoint="http://localhost:4317")
# Processes traces in batches as opposed to immediately one after the other
span_processor = BatchExportSpanProcessor(otlp_exporter)
span_processor = BatchSpanProcessor(otlp_exporter)
# Configures the Global Tracer Provider
trace.set_tracer_provider(TracerProvider(active_span_processor=span_processor, ids_generator=AwsXRayIdsGenerator()))
trace.set_tracer_provider(TracerProvider(active_span_processor=span_processor, ids_generator=AwsXRayIdGenerator()))
```

The `endpoint=` argument allows you to set the address that the exporter will use to connect to the collector. If unset, the SDK will try to connect to `http://localhost:4317` by default. Note that because the scheme is `http` by default, you have to explicitly set it to be `https` if necessary.
Expand Down

0 comments on commit 8edf143

Please sign in to comment.