Last active
October 4, 2023 00:47
-
-
Save yurishkuro/c60011b9b3b3e6b5c11f0852f877a6c3 to your computer and use it in GitHub Desktop.
OpenTelemetry Python Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from opentelemetry import trace | |
from opentelemetry.sdk.trace import TracerProvider | |
from opentelemetry.sdk.trace.export import BatchSpanProcessor | |
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter | |
trace.set_tracer_provider(TracerProvider()) | |
trace.get_tracer_provider().add_span_processor( | |
BatchSpanProcessor(OTLPSpanExporter()) | |
) | |
tracer = trace.get_tracer(__name__) | |
with tracer.start_as_current_span("foo"): | |
print("Hello world!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opentelemetry-api | |
opentelemetry-sdk | |
opentelemetry-exporter-otlp-proto-http |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jaeger is run like this: