Feat/observability package#149
Conversation
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-149-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-149-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-149.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-149-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_149 | stitch-dev.postgres.database.azure.com |
5432 |
pr_149 |
Jobs (2)
| job | image | postgres_db | api_url | auth_mode |
|---|---|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-149@sha256:d657423455f6b3bbc01e0339f6e27a7b9a9f030d99d311d60469399dd0f25614 |
pr_149 |
||
| seed | ghcr.io/rmi/stitch-seed:pr-149@sha256:2ab37e2bf672fa9cf622d1a37d327f4729196f20116a8c25742009b085909f05 |
https://pr-149-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io/api/v1 |
stitch-client-bearer-token |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-06-26T10:08:31Z | 2026-06-26T10:08:12Z | 085e799 | ghcr.io/rmi/stitch-api:pr-149 |
ghcr.io/rmi/stitch-api:pr-149@sha256:d657423455f6b3bbc01e0339f6e27a7b9a9f030d99d311d60469399dd0f25614 |
| 2026-06-26T10:08:33Z | 2026-06-26T10:08:12Z | 085e799 | ghcr.io/rmi/stitch-entity-linkage:pr-149 |
ghcr.io/rmi/stitch-entity-linkage:pr-149@sha256:5107a68e083c088058db23f181e62200f39a3c6db95482d07858357f8d83031d |
| 2026-06-26T10:08:30Z | 2026-06-26T10:08:12Z | 085e799 | ghcr.io/rmi/stitch-seed:pr-149 |
ghcr.io/rmi/stitch-seed:pr-149@sha256:2ab37e2bf672fa9cf622d1a37d327f4729196f20116a8c25742009b085909f05 |
| 2026-06-26T10:08:32Z | 2026-06-26T10:08:12Z | 085e799 | ghcr.io/rmi/stitch-stitch-llm:pr-149 |
ghcr.io/rmi/stitch-stitch-llm:pr-149@sha256:f4d4678fc83c2897f61b864fb4142e1104238ca5ee08837863a92ddcf4d4c941 |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-149-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-149-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-149.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-149-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_149 | stitch-dev.postgres.database.azure.com |
5432 |
pr_149 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-149@sha256:92278700b90b25eb4edb052443c8b55b4be46bdd187b9ddf00548fe3161090fe |
pr_149 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-06-26T10:09:15Z | 2026-06-26T10:08:56Z | b5d401f | ghcr.io/rmi/stitch-api:pr-149 |
ghcr.io/rmi/stitch-api:pr-149@sha256:92278700b90b25eb4edb052443c8b55b4be46bdd187b9ddf00548fe3161090fe |
| 2026-06-26T10:09:12Z | 2026-06-26T10:08:56Z | b5d401f | ghcr.io/rmi/stitch-entity-linkage:pr-149 |
ghcr.io/rmi/stitch-entity-linkage:pr-149@sha256:ef2474ed431a52246c787a91e98ad6e57a7668b796c0a09225cf88cc7a5ec7a6 |
| 2026-06-26T10:09:14Z | 2026-06-26T10:08:56Z | b5d401f | ghcr.io/rmi/stitch-seed:pr-149 |
ghcr.io/rmi/stitch-seed:pr-149@sha256:ca596b7ed2b50dac8b35752ef63f0077c4da8d2c581e52bbdbb4033b85f830d8 |
| 2026-06-26T10:09:11Z | 2026-06-26T10:08:56Z | b5d401f | ghcr.io/rmi/stitch-stitch-llm:pr-149 |
ghcr.io/rmi/stitch-stitch-llm:pr-149@sha256:694555e7576bbc6b3b7bea22083945377ab482d6c159a52f9a0b2522866a05d2 |
CD summary
|
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_149 | stitch-dev.postgres.database.azure.com |
5432 |
pr_149 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-06-26T10:15:12Z | 2026-06-26T10:14:54Z | e5ae63a | ghcr.io/rmi/stitch-api:pr-149 |
ghcr.io/rmi/stitch-api:pr-149@sha256:f4f221a5d4c5f142071ae16b8377c722bc56b73d5c4e182c273074ff0c714468 |
| 2026-06-26T10:15:12Z | 2026-06-26T10:14:54Z | e5ae63a | ghcr.io/rmi/stitch-entity-linkage:pr-149 |
ghcr.io/rmi/stitch-entity-linkage:pr-149@sha256:4ad3eca7c85c4269c45078ce908adc12c29b31e00463a2256c1c4eaec4f87539 |
| 2026-06-26T10:15:16Z | 2026-06-26T10:14:54Z | e5ae63a | ghcr.io/rmi/stitch-seed:pr-149 |
ghcr.io/rmi/stitch-seed:pr-149@sha256:9d723225c8eedddb503279f9d4f48531014fb9aab28a7f197c1af5d7c644d2e0 |
| 2026-06-26T10:15:12Z | 2026-06-26T10:14:54Z | e5ae63a | ghcr.io/rmi/stitch-stitch-llm:pr-149 |
ghcr.io/rmi/stitch-stitch-llm:pr-149@sha256:793aa413b79ef474dda5ee833a6863431e9cd46b87a94aec874b39c75dc9a5c1 |
There was a problem hiding this comment.
Pull request overview
Extracts OpenTelemetry tracing configuration + instrumentation into a reusable stitch-observability package, then wires it into stitch-service (app factory) and adopts it across api, entity-linkage, and stitch-llm. Also adds a job.run span to stitch-jobs to link background job runs back to the triggering request via span links.
Changes:
- Add new
packages/stitch-observabilitypackage (settings + tracing configuration + FastAPI/httpx/SQLAlchemy instrumentation helpers). - Update
stitch-service.create_appto optionally configure/instrument tracing when providedservice_name+OTelSettings. - Add OpenTelemetry tracing spans for
stitch-jobsruns and adoptOTelSettingsin service deployment settings; update build/test targets accordingly.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds stitch-observability workspace member + OTel httpx instrumentation dependency lock entries. |
| pyproject.toml | Adds packages/stitch-observability to workspace members. |
| packages/stitch-service/src/stitch/service/app.py | Adds optional OTel tracing setup + FastAPI/httpx instrumentation and shutdown hook in lifespan. |
| packages/stitch-service/src/stitch/service/init.py | Updates package docstring to reflect new optional tracing behavior. |
| packages/stitch-service/README.md | Documents how to enable tracing via service_name + otel params. |
| packages/stitch-service/pyproject.toml | Adds dependency/source mapping for stitch-observability. |
| packages/stitch-observability/tests/test_tracing.py | Adds unit tests for tracing config + logging exporter behavior. |
| packages/stitch-observability/src/stitch/observability/tracing.py | Introduces shared tracer provider configuration + instrumentors + logging span exporter. |
| packages/stitch-observability/src/stitch/observability/settings.py | Adds OTelSettings BaseSettings mixin for shared OTEL_* env vars. |
| packages/stitch-observability/src/stitch/observability/init.py | Exposes public API for settings/tracing helpers. |
| packages/stitch-observability/README.md | Documents usage and exporter modes. |
| packages/stitch-observability/pyproject.toml | Defines new package metadata and dependencies. |
| packages/stitch-jobs/tests/test_tracing.py | Adds tests verifying job.run span behavior and link to trigger span. |
| packages/stitch-jobs/src/stitch/jobs/store.py | Clarifies in-memory persistence semantics vs DB-backed follow-up. |
| packages/stitch-jobs/src/stitch/jobs/manager.py | Adds job.run span creation, linking, error status/exception recording, and span attributes. |
| packages/stitch-jobs/pyproject.toml | Adds opentelemetry-api dependency and SDK to dev deps for tests. |
| Makefile | Adds build/test targets for stitch-observability and includes them in aggregate targets. |
| deployments/stitch-llm/src/stitch/llm/settings.py | Switches settings base to OTelSettings mixin. |
| deployments/stitch-llm/src/stitch/llm/main.py | Enables tracing via create_app(service_name=..., otel=settings). |
| deployments/stitch-llm/pyproject.toml | Adds stitch-observability dependency/source mapping. |
| deployments/stitch-llm/conftest.py | Disables tracing during test runs by default via env var. |
| deployments/entity-linkage/src/stitch/entity_linkage/settings.py | Switches settings base to OTelSettings mixin. |
| deployments/entity-linkage/src/stitch/entity_linkage/main.py | Enables tracing via create_app(service_name=..., otel=settings). |
| deployments/entity-linkage/pyproject.toml | Adds stitch-observability dependency/source mapping. |
| deployments/entity-linkage/conftest.py | Disables tracing during test runs by default via env var. |
| deployments/api/tests/observability/test_tracing.py | Updates logger name expected by tracing tests to shared exporter logger. |
| deployments/api/src/stitch/api/observability/tracing.py | Replaces API-specific tracing impl with wrapper around shared stitch.observability. |
| deployments/api/pyproject.toml | Adds stitch-observability dependency/source mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if not enabled or exporter == "none": | ||
| return None | ||
|
|
||
| resource = Resource.create( | ||
| { | ||
| "service.name": service_name, | ||
| "service.version": version or "unknown", | ||
| "deployment.environment": environment, | ||
| } | ||
| ) | ||
| sampler = ParentBased(root=TraceIdRatioBased(sample_ratio)) | ||
| provider = TracerProvider(resource=resource, sampler=sampler) |
| async def _wait_terminal(manager: JobManager, job_id: str, *, timeout=2.0): | ||
| deadline = asyncio.get_event_loop().time() + timeout | ||
| while asyncio.get_event_loop().time() < deadline: |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-149-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-149-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-149.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-149-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_149 | stitch-dev.postgres.database.azure.com |
5432 |
pr_149 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-149@sha256:a9cdff6d7f6684f909f57b4970291d3df9c5064e61bef1976fd89eacc529e2dc |
pr_149 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-06-26T11:04:05Z | 2026-06-26T11:03:53Z | 81583f7 | ghcr.io/rmi/stitch-api:pr-149 |
ghcr.io/rmi/stitch-api:pr-149@sha256:a9cdff6d7f6684f909f57b4970291d3df9c5064e61bef1976fd89eacc529e2dc |
| 2026-06-26T11:04:05Z | 2026-06-26T11:03:53Z | 81583f7 | ghcr.io/rmi/stitch-entity-linkage:pr-149 |
ghcr.io/rmi/stitch-entity-linkage:pr-149@sha256:546f2e6d4ac0b4d7e09690b76869987252a4d9bb7bc62d5afe40307132df2582 |
| 2026-06-26T11:04:09Z | 2026-06-26T11:03:53Z | 81583f7 | ghcr.io/rmi/stitch-seed:pr-149 |
ghcr.io/rmi/stitch-seed:pr-149@sha256:6c6d04b41965e40d418ebf2c6a6e0949ba789759c94d90a4d1e656ddd8a7e8fc |
| 2026-06-26T11:04:08Z | 2026-06-26T11:03:53Z | 81583f7 | ghcr.io/rmi/stitch-stitch-llm:pr-149 |
ghcr.io/rmi/stitch-stitch-llm:pr-149@sha256:a3c880c8118fe8c6afb9c18eca02e0aa0bd38499eabd262fa4282c0630f6b735 |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-149-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-149-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-149.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-149-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_149 | stitch-dev.postgres.database.azure.com |
5432 |
pr_149 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-149@sha256:3e358932a9ddd4113aece5b37253554de9ac07980004307ec9e7af4350fd3d7c |
pr_149 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-02T14:39:05Z | 2026-07-02T14:38:43Z | 8d85653 | ghcr.io/rmi/stitch-api:pr-149 |
ghcr.io/rmi/stitch-api:pr-149@sha256:3e358932a9ddd4113aece5b37253554de9ac07980004307ec9e7af4350fd3d7c |
| 2026-07-02T14:39:07Z | 2026-07-02T14:38:43Z | 8d85653 | ghcr.io/rmi/stitch-entity-linkage:pr-149 |
ghcr.io/rmi/stitch-entity-linkage:pr-149@sha256:f36f55962aff73a35c42f3e8bb44fe77c32ad5643100130d28204122e8875cc5 |
| 2026-07-02T14:39:06Z | 2026-07-02T14:38:43Z | 8d85653 | ghcr.io/rmi/stitch-seed:pr-149 |
ghcr.io/rmi/stitch-seed:pr-149@sha256:7501511a6e3c70b7566ba0a5a928a78035b00150636c22aa46e434be8e80de61 |
| 2026-07-02T14:39:04Z | 2026-07-02T14:38:43Z | 8d85653 | ghcr.io/rmi/stitch-stitch-llm:pr-149 |
ghcr.io/rmi/stitch-stitch-llm:pr-149@sha256:ab09c52c3a7366cdb00e276dfc1c549c1d00c1338786ac62c0f4991462fbe1ea |
|
Superseded by #160 |
Followup to #143, extracting the observability features from
apiinto a package,stitch-observability, so that it can be reused institch-serviceas well