Prometheus exporter should return empty body with 200 code not 204 when no metrics #3582
Labels
bug
Something isn't working
pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore
Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package
Bug Report
Not sure if exactly the same as mentioned in #2400 since that mentions a part of the system not being ready, but I think I encountered the 204 issue when simply no metrics had been populated yet. If this is the same issue, IMO keeping this one to track this specific issue outside of a catch-all would be nice.
For the case when there are no metrics, the Prometheus export should return an empty body with 200 status code, not "204 Empty Content", because the Prometheus scraper will think it is an error.
After I hit my health check endpoint it caused a counter to be modified which resulted in the metrics export returning content finally:
The text was updated successfully, but these errors were encountered: