|
22 | 22 | from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter |
23 | 23 | from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor |
24 | 24 | from opentelemetry.sdk.resources import ( |
25 | | - DEPLOYMENT_ENVIRONMENT, |
26 | 25 | SERVICE_NAME, |
27 | 26 | SERVICE_VERSION, |
28 | 27 | OTELResourceDetector, |
|
48 | 47 | VERSION = "Unknown" |
49 | 48 |
|
50 | 49 | DEV = os.getenv("DEV", "false").lower() == "true" |
51 | | -ENVIRONMENT = "development" if DEV else "production" |
52 | 50 |
|
53 | 51 | if os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"): |
54 | 52 | OTEL_RESOURCE = Resource.create( |
55 | 53 | { |
56 | 54 | SERVICE_NAME: "etos-api", |
57 | 55 | SERVICE_VERSION: VERSION, |
58 | | - DEPLOYMENT_ENVIRONMENT: ENVIRONMENT, |
59 | 56 | }, |
60 | 57 | ) |
61 | 58 |
|
|
68 | 65 | PROCESSOR = BatchSpanProcessor(EXPORTER) |
69 | 66 | PROVIDER.add_span_processor(PROCESSOR) |
70 | 67 | trace.set_tracer_provider(PROVIDER) |
71 | | - setup_logging("ETOS API", VERSION, ENVIRONMENT, OTEL_RESOURCE) |
| 68 | + setup_logging("ETOS API", VERSION, OTEL_RESOURCE) |
72 | 69 |
|
73 | 70 | FastAPIInstrumentor().instrument_app(APP, tracer_provider=PROVIDER, excluded_urls=".*/ping") |
74 | 71 | else: |
75 | | - setup_logging("ETOS API", VERSION, ENVIRONMENT) |
| 72 | + setup_logging("ETOS API", VERSION) |
76 | 73 |
|
77 | 74 | RegisterProviders() |
0 commit comments