mirror of
https://github.com/cpacker/MemGPT.git
synced 2025-06-03 04:30:22 +00:00
feat: add support for custom service name in logging (#1194)
This commit is contained in:
parent
605f1ab415
commit
fcfeae12fc
@ -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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user