Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: add support for custom service name in logging (#1194)

cthomase32f446b6035
diff --git a/compose.tracing.yaml b/compose.tracing.yaml
index 80d6a3c15..169ab5172 100644
--- a/compose.tracing.yaml
+++ b/compose.tracing.yaml
@@ -1,6 +1,7 @@
services:
letta_server:
environment:
+ - ENV_NAME=${ENV_NAME} # optional service name
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317
otel-collector:
diff --git a/letta/server/rest_api/app.py b/letta/server/rest_api/app.py
index d6a4ff605..246711bc7 100644
--- a/letta/server/rest_api/app.py
+++ b/letta/server/rest_api/app.py
@@ -235,12 +235,14 @@ def create_application() -> "FastAPI":
endpoint = os.getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
if endpoint:
print(f"▶ Using OTLP tracing with endpoint: {endpoint}")
+ env_name_suffix = os.getenv("ENV_NAME")
+ service_name = f"letta-server-{env_name_suffix.lower()}" if env_name_suffix else "letta-server"
from letta.tracing import setup_tracing
setup_tracing(
endpoint=endpoint,
app=app,
- service_name="memgpt-server",
+ service_name=service_name,
)
for route in v1_routes: