opentelemetry-js
opentelemetry-js copied to clipboard
Export metrics api handler from "exporter-prometheus"
trafficstars
Problem.
exporter-prometheus depends on exporting new endpoint on a port that is separate than the default app port. This requires additional work from the service side to reserve ports and additional work to discover this assigned port from the scrapper side.
Solution
If the Metric reader can export a handler that returns the current metrics, this can be directly used within the main app server endpoint. This avoids having a separate server listening for the metrics endpoint and simplifies the port discovery by reusing main app http port.