Skip to content

Commit f8e527d

Browse files
author
Fredrik Fristedt
authored
Remove in-service telemetry signals envrionment logic (#108)
Since the logic to figure out in what environment the service is running is very limited, we remove the logic and let it be handled better somewhere outside of the service.
1 parent c9b064d commit f8e527d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ classifiers = [
1616
]
1717
requires-python = ">=3.9"
1818
dependencies = [
19-
"etos_lib==4.5.0",
19+
"etos_lib==5.1.2",
2020
"etcd3gw~=2.3",
2121
"uvicorn~=0.22",
2222
"fastapi~=0.115.6",

python/src/etos_api/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
2323
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
2424
from opentelemetry.sdk.resources import (
25-
DEPLOYMENT_ENVIRONMENT,
2625
SERVICE_NAME,
2726
SERVICE_VERSION,
2827
OTELResourceDetector,
@@ -48,14 +47,12 @@
4847
VERSION = "Unknown"
4948

5049
DEV = os.getenv("DEV", "false").lower() == "true"
51-
ENVIRONMENT = "development" if DEV else "production"
5250

5351
if os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT"):
5452
OTEL_RESOURCE = Resource.create(
5553
{
5654
SERVICE_NAME: "etos-api",
5755
SERVICE_VERSION: VERSION,
58-
DEPLOYMENT_ENVIRONMENT: ENVIRONMENT,
5956
},
6057
)
6158

@@ -68,10 +65,10 @@
6865
PROCESSOR = BatchSpanProcessor(EXPORTER)
6966
PROVIDER.add_span_processor(PROCESSOR)
7067
trace.set_tracer_provider(PROVIDER)
71-
setup_logging("ETOS API", VERSION, ENVIRONMENT, OTEL_RESOURCE)
68+
setup_logging("ETOS API", VERSION, OTEL_RESOURCE)
7269

7370
FastAPIInstrumentor().instrument_app(APP, tracer_provider=PROVIDER, excluded_urls=".*/ping")
7471
else:
75-
setup_logging("ETOS API", VERSION, ENVIRONMENT)
72+
setup_logging("ETOS API", VERSION)
7673

7774
RegisterProviders()

0 commit comments

Comments
 (0)