Skip to content

Commit 590ff70

Browse files
authored
Fixed formatting issues in AWSXRayRemoteSampler code snippet
1 parent 6a10a57 commit 590ff70

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

design-docs/python-centralized-sampling.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ The OpenTelemetry Specification contains a [Sampler interface](https://github.co
4747
The code snippet below demonstrates how a customer would configure their tracer provider to use the proposed remote sampler. Assume that the new sampler has been named `RemoteSampler`
4848

4949
```python
50-
**from** **opentelemetry** **import** trace
51-
**from** **opentelemetry****.****sdk****.****trace** **import** TracerProvider
52-
**from** **opentelemetry****.****sdk****.****trace****.****export** **import** (
50+
from opentelemetry import trace
51+
from opentelemetry.sdk.trace import TracerProvider
52+
from opentelemetry.sdk.trace.export import (
5353
ConsoleSpanExporter, SimpleSpanProcessor,
5454
)
5555

5656
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
5757

5858

5959
# import RemoteSampler from the OpenTelemetry SDK
60-
**from** **opentelemetry****.****sdk****.****extension****.****aws****.****trace****.****sampling** **import** AWSXRayRemoteSampler
60+
from opentelemetry.sdk.extension.aws.trace.sampling import AWSXRayRemoteSampler
6161

62-
*# instantiate RemoteSampler*
62+
# instantiate RemoteSampler
6363
# endpoint for port running the X-Ray Receiver (default = 2000)
6464
sampler = AWSXRayRemoteSampler(endpoint="http://localhost:2000")
6565

@@ -69,15 +69,15 @@ otlp_exporter = OTLPSpanExporter(endpoint="http://localhost:4317", insecure=True
6969
processor = SimpleSpanProcessor(otlp_exporter)
7070

7171

72-
*# set the remote sampler onto the global tracer provider*
72+
# set the remote sampler onto the global tracer provider
7373
trace.set_tracer_provider(
7474
TracerProvider(
7575
active_span_processor=processor,
7676
sampler=sampler,
7777
id_generator=AwsXRayIdGenerator()))
7878

79-
*# created spans will now be sampled by the new RemoteSampler*
80-
**with** trace.get_tracer(__name__).start_as_current_span("Test Span"):
79+
# created spans will now be sampled by the new RemoteSampler
80+
with trace.get_tracer(__name__).start_as_current_span("Test Span"):
8181
print("Testing Remote Sampler!")
8282
```
8383

@@ -93,7 +93,7 @@ The [X-Ray API docs](https://docs.aws.amazon.com/xray/latest/devguide/xray-api-s
9393
* *Reservoir*: A fixed number of matching requests to instrument per second before applying the fixed rate. (For example, the reservoir in the second sampling rule in this example indicates that 2 requests will be instrumented before applying the fixed rate of 0.1%).
9494
* *Borrowed from reservoir*: the number of requests sampled by borrowing from the reservoir.
9595

96-
![fig2](./images/centralized-sampling-python-fig2.png)i
96+
![fig2](./images/centralized-sampling-python-fig2.png)
9797

9898
Figure 2 - *Communication Between OpenTelemetry SDK and AWS X-Ray*
9999

0 commit comments

Comments
 (0)