Skip to content

feat: add prometheus endpoint#1008

Open
pauliyobo wants to merge 6 commits into
xataio:mainfrom
pauliyobo:issue903
Open

feat: add prometheus endpoint#1008
pauliyobo wants to merge 6 commits into
xataio:mainfrom
pauliyobo:issue903

Conversation

@pauliyobo

Copy link
Copy Markdown

Description

This PR allows pgstream to expose a configurable Prometheus endpoint, served from the existing health server, so metrics can be scraped directly via the OTel Prometheus exporter without requiring an OTLP collector.

Related Issue(s)

closes #903

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Changes Made

  • Add instrumentation.metrics.prometheus config (YAML and env vars) to enable/configure a Prometheus scrape endpoint.
  • Serve the endpoint from the health server (default path /metrics, returns 404 when disabled).
  • Wire the OTel Prometheus exporter into the meter provider independently of the OTLP exporter, so Prometheus works standalone without an OTLP endpoint configured.
  • Update configuration and observability docs for the new option.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

Additional Notes

I have made the endpoint configurable as well. Is that fine, or should I leave /metrics?

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.

Add Prometheus /metrics endpoint

1 participant