Bootstrap tracing in code for sanctions, replacing the zero-code wrapper
common/telemetry.py builds the Resource, TracerProvider, BatchSpanProcessor and OTLP/HTTP exporter by hand; sanctions calls setup_telemetry() at import instead of running under opentelemetry-instrument. No instrumentor is enabled yet, so sanctions emits no spans for now. service.version comes from OTEL_RESOURCE_ATTRIBUTES: deploy.sh exports DEPLOY_HASH (the server's HEAD after the pull) and compose falls back to "dev". deployment.environment.name=prod is dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
574d7f4038
commit
4baae96e6e
@@ -6,13 +6,14 @@ from pydantic import BaseModel
|
||||
|
||||
from common.db import engine
|
||||
from common.logging_config import configure_logging
|
||||
from common.redis_client import redis_client
|
||||
from common.telemetry import setup_telemetry
|
||||
|
||||
from . import chaos
|
||||
from .repository import is_match
|
||||
|
||||
SERVICE_NAME = "sanctions"
|
||||
logger = configure_logging(SERVICE_NAME)
|
||||
setup_telemetry(service_name=SERVICE_NAME)
|
||||
app = FastAPI(title=SERVICE_NAME)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user