You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add native, application-level Prometheus metrics for the STAC path, as a generic opt-in capability (everything off by default):
/metrics on stac-fastapi-pgstac and stac-auth-proxy (upstream in those repos)
opt-in scraping config and RED (rate / error / latency) dashboard panels in this chart
I'm proposing this from the EOEPCA project (See discussion here), where eoAPI is deployed behind a platform monitoring stack, but the work is intended to be generic (no EOEPCA-specific code anywhere).
Current gap
The chart's current monitoring is infrastructure-level. The platform can see that a request was slow, but not which STAC operation (search vs get-item vs list-collections) was slow, and error rates can't be attributed to an operation either.
Claude's analysis of the gap:
This was looked at before: EOEPCA/data-access#41 deliberately chose the ingress-exporter route to avoid forking the upstream apps, and EOEPCA/data-access#134 scoped out possible pathways without landing anything. Two things have changed since:
stac-fastapi now takes a middlewares parameter, so instrumentation is a plain opt-in middleware — no fork needed.
stac-utils/stac-fastapi-pgstac: optional metrics extra (prometheus-fastapi-instrumentator, gated by an ENABLE_METRICS env var following the existing settings pattern. Request counters + duration histograms labelled by route template, method and status class. (Raised on OpenTelemetry instrumentation stac-utils/stac-fastapi-pgstac#286, which tracks OpenTelemetry instrumentation, this Prometheus /metrics endpoint would be complementary to OTel tracing, not a replacement.)
developmentseed/stac-auth-proxy: same pattern, making sure /metrics is served by the proxy itself and not forwarded upstream.
This chart (eoapi-k8s): opt-in values to set ENABLE_METRICS on the stac container, a named service port, scraping enablement, and RED panels for the STAC service in the Grafana dashboard + unit tests coverage and docs changes
Out of scope for this first slice: raster/vector/multidim (can follow the same pattern later), tracing, and per-collection analytics
The current version of the chart bundles scraping through prometheus.io/scrape anotation. EOPECA run the Prometheus operator, in this case we should deploy a servicemonitor object. Should we ship both mechanisms default to off? So a user with the bundled Prometheus flips on annotations an a user with the operator (like EOEPCA) flips on the ServiceMonitor.
B. Values naming
Where does the on/off switch live in values.yaml? per-service toggle (stac.metrics.enabled, like autoscaling) or under the global monitoring block? I'll follow the recent #262 conventions either way.
Goal
Add native, application-level Prometheus metrics for the STAC path, as a generic opt-in capability (everything off by default):
I'm proposing this from the EOEPCA project (See discussion here), where eoAPI is deployed behind a platform monitoring stack, but the work is intended to be generic (no EOEPCA-specific code anywhere).
Current gap
The chart's current monitoring is infrastructure-level. The platform can see that a request was slow, but not which STAC operation (search vs get-item vs list-collections) was slow, and error rates can't be attributed to an operation either.
Claude's analysis of the gap:
Propose work
ENABLE_METRICSenv var following the existing settings pattern. Request counters + duration histograms labelled by route template, method and status class. (Raised on OpenTelemetry instrumentation stac-utils/stac-fastapi-pgstac#286, which tracks OpenTelemetry instrumentation, this Prometheus /metrics endpoint would be complementary to OTel tracing, not a replacement.)Out of scope for this first slice: raster/vector/multidim (can follow the same pattern later), tracing, and per-collection analytics
Are you happy with this proposal @vincentsarago @alukach @hrodmn @gadomski @ciaransweet @pantierra
Questions about the new eoapi-k8s helm chart
A. Prometheus scraping
The current version of the chart bundles scraping through prometheus.io/scrape anotation. EOPECA run the Prometheus operator, in this case we should deploy a servicemonitor object. Should we ship both mechanisms default to off? So a user with the bundled Prometheus flips on annotations an a user with the operator (like EOEPCA) flips on the ServiceMonitor.
B. Values naming
Where does the on/off switch live in values.yaml? per-service toggle (stac.metrics.enabled, like autoscaling) or under the global monitoring block? I'll follow the recent #262 conventions either way.