File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
packages/service-library/src/servicelib/fastapi Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change 99from opentelemetry .exporter .otlp .proto .http .trace_exporter import (
1010 OTLPSpanExporter as OTLPSpanExporterHTTP ,
1111)
12- from opentelemetry .instrumentation .fastapi import (
13- FastAPIInstrumentor , # pylint: disable=no-name-in-module
14- )
12+ from opentelemetry .instrumentation .fastapi import FastAPIInstrumentor
1513from opentelemetry .sdk .resources import Resource
1614from opentelemetry .sdk .trace import TracerProvider
1715from opentelemetry .sdk .trace .export import BatchSpanProcessor
@@ -29,15 +27,7 @@ def setup_tracing(
2927 ):
3028 log .warning ("Skipping opentelemetry tracing setup" )
3129 return
32- if (
33- not tracing_settings .TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT
34- or not tracing_settings .TRACING_OPENTELEMETRY_COLLECTOR_PORT
35- ):
36- msg = (
37- f"Variable opentelemetry_collector_endpoint [{ tracing_settings .TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT } ] "
38- f"or opentelemetry_collector_port [{ tracing_settings .TRACING_OPENTELEMETRY_COLLECTOR_PORT } ] unset. Tracing options incomplete."
39- )
40- raise RuntimeError (msg )
30+
4131 # Set up the tracer provider
4232 resource = Resource (attributes = {"service.name" : service_name })
4333 trace .set_tracer_provider (TracerProvider (resource = resource ))
You can’t perform that action at this time.
0 commit comments