diff --git a/.github/workflows/docker-image-nightly.yml b/.github/workflows/docker-image-nightly.yml index aff0b514..b6ea6263 100644 --- a/.github/workflows/docker-image-nightly.yml +++ b/.github/workflows/docker-image-nightly.yml @@ -23,5 +23,8 @@ jobs: - uses: actions/checkout@v3 - name: Build and push the Docker image (letta) run: | - docker build . --file Dockerfile --tag letta/letta:nightly + docker build . \ + --file Dockerfile \ + --tag letta/letta:nightly \ + --build-arg LETTA_VERSION="nightly-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" docker push letta/letta:nightly diff --git a/Dockerfile b/Dockerfile index 0e76854c..fc3f3a4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -70,6 +70,9 @@ ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \ POSTGRES_DB=letta \ COMPOSIO_DISABLE_VERSION_CHECK=true +# Set for other builds +ARG LETTA_VERSION +ENV LETTA_VERSION=${LETTA_VERSION} WORKDIR /app diff --git a/letta/__init__.py b/letta/__init__.py index e462b907..1d620eb7 100644 --- a/letta/__init__.py +++ b/letta/__init__.py @@ -1,5 +1,11 @@ +import os + __version__ = "0.7.14" +if os.environ.get("LETTA_VERSION"): + __version__ = os.environ["LETTA_VERSION"] + + # import clients from letta.client.client import RESTClient diff --git a/letta/tracing.py b/letta/tracing.py index d54963e3..de3e4c5e 100644 --- a/letta/tracing.py +++ b/letta/tracing.py @@ -16,6 +16,8 @@ from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.trace import Status, StatusCode +from letta import __version__ as letta_version + tracer = trace.get_tracer(__name__) _is_tracing_initialized = False _excluded_v1_endpoints_regex: List[str] = [ @@ -24,6 +26,7 @@ _excluded_v1_endpoints_regex: List[str] = [ # "^GET /v1/agents/(?P[^/]+)/archival-memory$", # "^GET /v1/agents/(?P[^/]+)/sources$", # r"^POST /v1/voice-beta/.*/chat/completions$", + "^GET /v1/health$", ] @@ -149,7 +152,8 @@ def setup_tracing( resource=Resource.create( { "service.name": service_name, - "device.id": uuid.getnode(), # MAC address as unique device identifier + "device.id": uuid.getnode(), # MAC address as unique device identifier, + "letta.version": letta_version, } ) )