Skip to content

fix: add Prometheus scraping for the STAC service - #618

Closed
komalRay wants to merge 2 commits into
developmentseed:mainfrom
komalRay:otel
Closed

komalRay wants to merge 2 commits into
developmentseed:mainfrom
komalRay:otel

Conversation

@komalRay

Copy link
Copy Markdown

Summary

Add optional Prometheus scraping support for the eoAPI STAC service in the Helm chart.

This change supports the OpenAerialMap v2 observability work by allowing the STAC service to expose its /metrics endpoint and by generating a Prometheus Operator ServiceMonitor for it.

Monitoring remains disabled by default and must be explicitly enabled.

Changes

  • Add STAC monitoring configuration to the Helm chart.
  • Add optional Prometheus ServiceMonitor generation.
  • Configure the monitor to:
    • Target the STAC Kubernetes service.
    • Scrape the named http service port.
    • Use the /metrics path.
    • Use a configurable scrape interval.
  • Add Helm tests covering the generated STAC monitoring configuration.
  • Preserve existing behavior when monitoring is disabled.

OpenAerialMap Context

This is the infrastructure portion of the first observability increment for OpenAerialMap v2.

The related OAM application change adds Prometheus instrumentation to the STAC API and exposes /metrics when enabled. This PR adds the Kubernetes chart configuration needed for Prometheus Operator discovery and scraping.

Related application repository:

https://github.com/hotosm/openaerialmap

Related OAM issue:

Validation

The chart and integration were validated locally using a Kubernetes cluster with Prometheus support.

Validated:

  • Helm chart renders successfully with monitoring disabled.
  • No ServiceMonitor is generated when monitoring is disabled.
  • Helm chart renders successfully with STAC monitoring enabled.
  • The generated ServiceMonitor selects the STAC service.
  • The generated ServiceMonitor uses the named http port.
  • The scrape path is /metrics.
  • The scrape interval is configurable.
  • The STAC service exposes /metrics when Prometheus monitoring is enabled.
  • Prometheus discovers the STAC target.
  • Prometheus reports the target as healthy with up = 1.
  • Request metrics are visible in Prometheus after generating STAC traffic.
  • Helm tests cover the generated STAC monitoring configuration.

Scope

This PR does not include:

  • OpenTelemetry tracing.
  • Sentry integration.
  • TiTiler instrumentation.
  • Instrumentation for other OAM v2 services.
  • Grafana dashboard creation.
  • Production deployment changes.

Those should be handled as follow-up work.

Checklist

  • I have tested the changes locally.
  • I have added or updated Helm tests where appropriate.
  • I have kept monitoring opt-in by default.
  • I have avoided unrelated changes.
  • Documentation updates are required.
  • Production rollout is required.

raykomal and others added 2 commits September 14, 2026 11:53
Expose the STAC metrics endpoint through the chart and add coverage for the generated service configuration.
@pantierra pantierra changed the title Add Prometheus scraping for the STAC service fix: Add Prometheus scraping for the STAC service Sep 15, 2026
@pantierra pantierra changed the title fix: Add Prometheus scraping for the STAC service fix: add Prometheus scraping for the STAC service Sep 15, 2026
@pantierra
pantierra self-requested a review September 15, 2026 20:51
@pantierra pantierra closed this Sep 15, 2026
@pantierra

Copy link
Copy Markdown
Contributor

Please review CONTRIBUTING.md for the AI Use Policy. Thank you.

@pantierra
pantierra removed their request for review September 15, 2026 20:57
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.

3 participants