Skip to content

feat(chart): add the logfire-source-maps service - #364

Open
adriangb wants to merge 13 commits into
mainfrom
logfire-source-maps-service
Open

adriangb wants to merge 13 commits into
mainfrom
logfire-source-maps-service

Conversation

@adriangb

@adriangb adriangb commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Logfire ingest resolves browser stack frames through a new internal service, logfire-source-maps. This PR adds that service to the chart behind logfire-source-maps.enabled, which is off by default, so an upgrade changes nothing until an operator turns it on.

Changes

  • templates/logfire-source-maps.yaml renders a Deployment and a ClusterIP Service, based on logfire-backend-auth. It uses port 8003, runs python -m logfire_source_maps from logfire-source-maps-prod, and reads only CRUD_PG_DSN, FRONTEND_HOST and the telemetry settings. It has no Redis and no JWT.
  • In-cluster TLS gets a certificate for the service when it is enabled.
  • The service is in the image-identity, trusted-CA and dev-Postgres-wait lists, like logfire-backend-auth.
  • logfire-ff-ingest-config gets FF_SOURCE_MAPS_URL when the service is enabled, using the in-cluster TLS scheme and port.
  • When the service is enabled, the backend gets SOURCE_MAPS_OBJECT_STORE_URI, the worker gets it too, and ingest gets FF_SOURCE_MAPS_OBJECT_STORE_URI. All three are <objectStoreUri>/_source_maps, the same prefix pattern as FF_FAILOVER_OBJECT_STORE_URI. The worker needs the URI to delete blobs. The backend needs it only until its upload routes move out.
  • Coupling tests check that the ingest URL matches the Service port, and that the three services use the same object store URI.

Storage move

Today a self-hosted install with no URI stores source maps on the backend pod's local disk, at file:///var/lib/logfire/source-maps. Ingest cannot read that disk. So when the service is enabled, maps move to the _source_maps prefix of the shared object store. Maps that are already on a pod's disk are not copied. A project uploads them again on its next release build.

Platform PR: https://github.com/pydantic/platform/pull/55571

Validation

  • helm template renders the service and the URL with the flag on. With the flag off, it renders neither.
  • I have not run helm unittest locally, because the plugin is not installed.

The chart must not enable this by default until a platform release publishes the logfire-source-maps-prod image.

This PR also includes the ingest processor ephemeral storage request (4 GiB) from #363.

Fusionfire ingest resolves browser stack frames through a new internal
service, logfire-source-maps. The chart renders its Deployment, Service and
in-cluster certificate behind logfire-source-maps.enabled, which is off by
default, and gives the ingest config FF_SOURCE_MAPS_URL when it is enabled.
Fusionfire ingest reads uploaded source maps, so the maps cannot stay on
the backend pod's local disk. When logfire-source-maps.enabled is on, the
backend, the worker and ingest all get <objectStoreUri>/_source_maps, the
same prefix pattern as FF_FAILOVER_OBJECT_STORE_URI.
The chart-testing lint requires a version bump on a chart change.
Fusionfire ingest now serves /v1/sourcemaps/. Without an HAProxy rule the
request matches path_backend and reaches the backend. Ingest also needs
FF_SOURCE_MAPS_ENABLED to accept the route.
The ingest processor keeps a per-pod disk cache of compiled browser source maps
when the source-maps service is enabled. Without a request, the scheduler can
place the pod on a node that lacks room for the cache.

Request `ephemeral-storage: 4Gi` for `logfire-ff-ingest-processor` in the tiny,
small, standard and large sizing presets. Only the request changes. The shared
`/tmp` emptyDir has no per-workload `sizeLimit` in the chart, so this keeps the
resource request instead of a volume limit.
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md
#	charts/logfire/templates/_helpers.tpl
logfire.autoscaler on main renders the PDB itself, so the template's own
logfire.pdb call produced a second PodDisruptionBudget with the same name.
…into logfire-source-maps-service

# Conflicts:
#	charts/logfire/Chart.yaml
#	charts/logfire/README.md

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant