diff --git a/Dockerfile b/Dockerfile index e5cae4650..65abb8f0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,8 +64,7 @@ ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \ POSTGRES_USER=letta \ POSTGRES_PASSWORD=letta \ POSTGRES_DB=letta \ - COMPOSIO_DISABLE_VERSION_CHECK=true \ - LETTA_OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 + COMPOSIO_DISABLE_VERSION_CHECK=true WORKDIR /app diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py index 363eca328..6212e584e 100644 --- a/letta/server/rest_api/app.py +++ b/letta/server/rest_api/app.py @@ -256,7 +256,7 @@ def create_application() -> "FastAPI": ) # Set up OpenTelemetry tracing - otlp_endpoint = os.getenv("LETTA_OTEL_EXPORTER_OTLP_ENDPOINT") + otlp_endpoint = settings.otel_exporter_otlp_endpoint if otlp_endpoint: print(f"▶ Using OTLP tracing with endpoint: {otlp_endpoint}") env_name_suffix = os.getenv("ENV_NAME") diff --git a/letta/tracing.py b/letta/tracing.py index 2275759c7..e0dda3d50 100644 --- a/letta/tracing.py +++ b/letta/tracing.py @@ -90,8 +90,8 @@ async def trace_error_handler(_request: Request, exc: Exception) -> JSONResponse # Add error details to current span span = trace.get_current_span() if span: - span.add_event( - name="exception", + span.record_exception( + exc, attributes={ "exception.message": error_msg, "exception.type": type(exc).__name__, diff --git a/otel-collector-config-clickhouse.yaml b/otel-collector-config-clickhouse.yaml index c18a1843a..6840610f1 100644 --- a/otel-collector-config-clickhouse.yaml +++ b/otel-collector-config-clickhouse.yaml @@ -62,6 +62,9 @@ exporters: max_elapsed_time: 300s service: + telemetry: + logs: + level: error pipelines: traces: receivers: [otlp] diff --git a/otel-collector-config-file.yaml b/otel-collector-config-file.yaml index 2552c0cc3..1dbc4c430 100644 --- a/otel-collector-config-file.yaml +++ b/otel-collector-config-file.yaml @@ -20,6 +20,9 @@ exporters: max_backups: 5 service: + telemetry: + logs: + level: error pipelines: traces: receivers: [otlp]