Observability Package#160
Conversation
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (2)
| job | image | postgres_db | api_url | auth_mode |
|---|---|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:88077ac1408f0147a3c48747b5f8a746db0eaeb4334217b488bbef0eb8f018fe |
pr_160 |
||
| seed | ghcr.io/rmi/stitch-seed:pr-160@sha256:fd02f14ffd1856af400a5ec4a497fb0c182131bacdc17fc5cd684f8f84aa92fc |
https://pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io/api/v1 |
stitch-client-bearer-token |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-06T15:13:22Z | 2026-07-06T15:13:00Z | e67d685 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:88077ac1408f0147a3c48747b5f8a746db0eaeb4334217b488bbef0eb8f018fe |
| 2026-07-06T15:13:20Z | 2026-07-06T15:13:00Z | e67d685 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:5f05d2e936366adf7dc150718c67e66a4c70e86f9b739f5179b517d38c1032eb |
| 2026-07-06T15:13:20Z | 2026-07-06T15:13:00Z | e67d685 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:fd02f14ffd1856af400a5ec4a497fb0c182131bacdc17fc5cd684f8f84aa92fc |
| 2026-07-06T15:13:18Z | 2026-07-06T15:13:00Z | e67d685 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:f42d0b5880a72b382145054f7c5fd37a7ad0e5fd5e61474defde4678b8b0238e |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:cbaee76371015e46da1f5713bf2dcf9cdca4360781bbe01121619de93fecd27e |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-06T15:41:28Z | 2026-07-06T15:41:12Z | a773284 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:cbaee76371015e46da1f5713bf2dcf9cdca4360781bbe01121619de93fecd27e |
| 2026-07-06T15:41:28Z | 2026-07-06T15:41:12Z | a773284 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:7ba4075af718671ba1fffa72297bd91fde35b23859932d5985fd5a1e2d602dee |
| 2026-07-06T15:41:28Z | 2026-07-06T15:41:12Z | a773284 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:964e7b9b4a59d6b6a838d82075a4a566a0783a2fa034888599ed2cb77e18c6b2 |
| 2026-07-06T15:41:29Z | 2026-07-06T15:41:12Z | a773284 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:48d6f8eed88d5e4960e48500b51f722b531f3b652b1bd5292288e39010f74d3e |
There was a problem hiding this comment.
Pull request overview
This PR extracts shared OpenTelemetry tracing setup into a new reusable stitch-observability package and wires it into the API, entity-linkage, and stitch-llm services to enable consistent end-to-end tracing (including traceparent propagation via httpx instrumentation).
Changes:
- Adds new
packages/stitch-observabilitypackage (settings + tracing config + FastAPI/httpx/SQLAlchemy instrumentation helpers) with unit tests and README. - Replaces the API tracing implementation with a thin shim delegating to
stitch.observability(keeping existing call sites stable) and updates API tracing tests accordingly. - Wires tracing into entity-linkage and stitch-llm apps (startup configuration, FastAPI/httpx instrumentation, and shutdown), and updates workspace/build tooling (uv workspace members, Makefile targets, lockfile).
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds workspace package entry and dependency graph updates (incl. httpx instrumentation). |
| pyproject.toml | Registers packages/stitch-observability as a uv workspace member. |
| PLAN.md | Adds implementation plan/notes for the extraction and wiring work. |
| packages/stitch-observability/tests/test_tracing.py | Adds package-level tests for provider construction, exporter logging, truncation, and settings bounds. |
| packages/stitch-observability/src/stitch/observability/tracing.py | Implements shared tracing configuration, exporters, attribute truncation, and instrumentation helpers. |
| packages/stitch-observability/src/stitch/observability/settings.py | Adds OTelSettings BaseSettings mixin for shared OTEL_* env configuration. |
| packages/stitch-observability/src/stitch/observability/init.py | Re-exports public API surface for the observability package. |
| packages/stitch-observability/README.md | Documents package usage and intended service wiring pattern. |
| packages/stitch-observability/pyproject.toml | Defines package metadata and dependencies for stitch-observability. |
| Makefile | Adds build/test targets for the new package and includes them in aggregate targets/.PHONY. |
| deployments/stitch-llm/src/stitch/llm/settings.py | Switches service settings to inherit OTelSettings. |
| deployments/stitch-llm/src/stitch/llm/main.py | Adds tracing configuration + FastAPI/httpx instrumentation and shutdown in lifespan. |
| deployments/stitch-llm/pyproject.toml | Adds stitch-observability as a dependency and workspace source. |
| deployments/stitch-llm/conftest.py | Disables tracing in test runs via OTEL_TRACES_EXPORTER=none. |
| deployments/entity-linkage/src/stitch/entity_linkage/settings.py | Switches service settings to inherit OTelSettings. |
| deployments/entity-linkage/src/stitch/entity_linkage/main.py | Adds tracing configuration + FastAPI/httpx instrumentation and shutdown in lifespan. |
| deployments/entity-linkage/pyproject.toml | Adds stitch-observability as a dependency and workspace source. |
| deployments/entity-linkage/conftest.py | Disables tracing in test runs via OTEL_TRACES_EXPORTER=none. |
| deployments/api/tests/observability/test_tracing.py | Updates tests for new logger name and improves isolation by patching set_tracer_provider. |
| deployments/api/src/stitch/api/observability/tracing.py | Replaces implementation with a compatibility shim over stitch.observability. |
| deployments/api/src/stitch/api/main.py | Adds _tracer_provider pre-declaration to avoid lifespan NameError edge case. |
| deployments/api/src/stitch/api/db/config.py | Adds comment clarifying engine instrumentation is once-per-process due to @lru_cache. |
| deployments/api/pyproject.toml | Adds stitch-observability as a dependency and workspace source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:40224ccdeb1a07ab7f1b898638015ff1a74ee08c285067c686e7b24124e6c405 |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-08T09:36:44Z | 2026-07-08T09:36:23Z | 73f3fb9 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:40224ccdeb1a07ab7f1b898638015ff1a74ee08c285067c686e7b24124e6c405 |
| 2026-07-08T09:36:42Z | 2026-07-08T09:36:23Z | 73f3fb9 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:c14ad8afc7923bba43bc6e62bf89f3240d5f8e60bc64071d8a2f096818efb2d8 |
| 2026-07-08T09:36:41Z | 2026-07-08T09:36:23Z | 73f3fb9 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:c947ec4e8d97692fbc42664be959644ceb7d485c3c50b001f1f03b4613b24430 |
| 2026-07-08T09:36:40Z | 2026-07-08T09:36:23Z | 73f3fb9 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:9a5a9193290229e82f556d2907c62cb5afde15d034bb45344b28d41bb3eecca4 |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:d73da2c0b9c691383e1638523915486ae60e300234927ed5fc67e105d9d2f27e |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-09T11:47:26Z | 2026-07-09T11:46:32Z | d5174cd | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:d73da2c0b9c691383e1638523915486ae60e300234927ed5fc67e105d9d2f27e |
| 2026-07-09T11:47:26Z | 2026-07-09T11:46:32Z | d5174cd | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:71844aaa0ec2d7d644ec983b5d8a851e5cb9db0f71036a2d1e66eab342ea76c0 |
| 2026-07-09T11:47:26Z | 2026-07-09T11:46:32Z | d5174cd | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:4f14c1cf44c30629dd76ec9685a209c16225081c48867bb982fed6b554cdcabc |
| 2026-07-09T11:47:30Z | 2026-07-09T11:46:32Z | d5174cd | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:d46d1e7d330f6221aead5ce6f8726709b8a32edd6b9fdf0004bd5a3940a327f5 |
| POSTGRES_USER=${{ needs.deploy-db.outputs.postgres-user }} | ||
| PGSSLMODE=${{ needs.deploy-db.outputs.postgres-sslmode }} | ||
| OTEL_SERVICE_NAME=stitch-api | ||
| OTEL_RESOURCE_ATTRIBUTES=deployment.name=${{ needs.resolve-context.outputs.deployment-name }},deployment.lane=${{ needs.resolve-context.outputs.deployment-lane }},service.version=${{ github.sha }} |
There was a problem hiding this comment.
Note we're setting these vars, but not making use of them until PR #161
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:0e5cb8ab70fed056586b20889f7adc805ea56a6b7e2b5f3a72c4593ad5edafbe |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-09T14:15:02Z | 2026-07-09T14:14:41Z | 589d60d | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:0e5cb8ab70fed056586b20889f7adc805ea56a6b7e2b5f3a72c4593ad5edafbe |
| 2026-07-09T14:15:04Z | 2026-07-09T14:14:41Z | 589d60d | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:d66055e07b8521cb7d61b1077500523d13c0ee725714a053e4d76f1322a1005c |
| 2026-07-09T14:14:58Z | 2026-07-09T14:14:41Z | 589d60d | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:4c29ce4dd07728dc32a13e3293acff2650b2912202688921b9485469cdadf968 |
| 2026-07-09T14:14:59Z | 2026-07-09T14:14:41Z | 589d60d | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:6cc619ec855a7a4c6077d5ecfa334823535f813c4d70817c1ccd6b6d885cc1ac |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:a3c1cac26ceda77e53bb110e8c1e53374477f6e36573c9b7dc1cca6f8af63a2a |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-09T14:19:19Z | 2026-07-09T14:19:03Z | 72f5189 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:a3c1cac26ceda77e53bb110e8c1e53374477f6e36573c9b7dc1cca6f8af63a2a |
| 2026-07-09T14:19:19Z | 2026-07-09T14:19:03Z | 72f5189 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:3dcf94afc426a79736a7c419a5347717a4acb9117e5d77e5b8a640f39e4142ec |
| 2026-07-09T14:19:20Z | 2026-07-09T14:19:03Z | 72f5189 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:2ae483e4f04379e90a1809f9fc7d41dc6a106c521c7c2ffcacf5415e65843660 |
| 2026-07-09T14:19:21Z | 2026-07-09T14:19:03Z | 72f5189 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:2d544276a5da7e8e7d7ce3ed4fd3ff5745c1d13b963db0bfb4bdca0ded5af8a2 |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:dacb5f00106f1249bca2db5985a38a487b88684667cdd37727ae99b54f110fd8 |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-09T14:47:03Z | 2026-07-09T14:46:46Z | fcc1654 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:dacb5f00106f1249bca2db5985a38a487b88684667cdd37727ae99b54f110fd8 |
| 2026-07-09T14:47:06Z | 2026-07-09T14:46:46Z | fcc1654 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:a81aaca8bec0b9a84471b56444fd5a3197f43e4016bbf160a57cfc56f7bf6ba4 |
| 2026-07-09T14:47:07Z | 2026-07-09T14:46:46Z | fcc1654 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:f1fa517cf3ffc67c69b615046d74fef69fe1ac4a6b403d298cb65514ceccaa14 |
| 2026-07-09T14:47:07Z | 2026-07-09T14:46:46Z | fcc1654 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:75880397876dc4c11cbd316e4d4938267a9d2c2bad57c87c15f8c09777ea4ce5 |
CD summary
|
| service | url | fqdn |
|---|---|---|
| api | open | pr-160-api.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| entity-linkage | open | pr-160-entity-linkage.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
| frontend | https://witty-mushroom-017a3dc1e-160.westus2.1.azurestaticapps.net | |
| stitch-llm | open | pr-160-stitch-llm.purplegrass-c07d0a94.westus2.azurecontainerapps.io |
Database (1)
| db_name | postgres_host | postgres_port | postgres_db |
|---|---|---|---|
| pr_160 | stitch-dev.postgres.database.azure.com |
5432 |
pr_160 |
Jobs (1)
| job | image | postgres_db |
|---|---|---|
| db-migrations | ghcr.io/rmi/stitch-api:pr-160@sha256:7a1004a3993659b9410ac3e3ea8610be1fa072ddec0e09cd0a68f372ce4245c1 |
pr_160 |
Images (4)
| build_time | commit_time | git_sha | image | image_digest |
|---|---|---|---|---|
| 2026-07-10T11:35:13Z | 2026-07-10T11:34:53Z | bc28907 | ghcr.io/rmi/stitch-api:pr-160 |
ghcr.io/rmi/stitch-api:pr-160@sha256:7a1004a3993659b9410ac3e3ea8610be1fa072ddec0e09cd0a68f372ce4245c1 |
| 2026-07-10T11:35:13Z | 2026-07-10T11:34:53Z | bc28907 | ghcr.io/rmi/stitch-entity-linkage:pr-160 |
ghcr.io/rmi/stitch-entity-linkage:pr-160@sha256:cebf32f128e6d160bdfff6cd4e3ddbe6a66b1ea27c872432bdc0b21ffd35c78b |
| 2026-07-10T11:35:13Z | 2026-07-10T11:34:53Z | bc28907 | ghcr.io/rmi/stitch-seed:pr-160 |
ghcr.io/rmi/stitch-seed:pr-160@sha256:7923c64a01cdd5e36c74ffc5f1c22f708b38942d1734e8ba1585045714c1c486 |
| 2026-07-10T11:35:11Z | 2026-07-10T11:34:53Z | bc28907 | ghcr.io/rmi/stitch-stitch-llm:pr-160 |
ghcr.io/rmi/stitch-stitch-llm:pr-160@sha256:5b0342aa532663cad16ebeab8ab52ebbef86698ce379c683f14f0c976af9a48e |
Supersedes #149
Extracts observability functionality into a workspace package, and calls it from the api, entity-linkage, and LLM services.
Cleans up leftovers from
api