Fix Content-Type header for Prometheus compliance#104
Open
Fix Content-Type header for Prometheus compliance#104
Conversation
Co-authored-by: saikatharryc <15653282+saikatharryc@users.noreply.github.com>
Co-authored-by: saikatharryc <15653282+saikatharryc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] No ContentType Header cause Prometheus Error
Fix Content-Type header for Prometheus compliance
Aug 3, 2025
|
@saikatharryc Is it possible to merge this MR soon ? |
saikatharryc
approved these changes
Sep 5, 2025
|
@saikatharryc Thanks for opening the MR! Should you also merge it manually? |
Owner
|
@ths83 - i realized that i did not maintain it for a while and even if i merge this it wont release automatically to the npm. |
|
can we merge and release please ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PM2 Prometheus exporter was sending an incomplete Content-Type header that caused Prometheus to report scraping errors:
While a Content-Type header was being set, it was missing the required
charset=utf-8parameter that Prometheus expects according to the exposition format specification.Before:
Content-Type: text/plain; version=0.0.4After:
Content-Type: text/plain; version=0.0.4; charset=utf-8This change ensures full compliance with the Prometheus exposition format and eliminates the need for users to configure workarounds like
fallback_scrape_protocol: "PrometheusText0.0.4"in their Prometheus scrape configs.The fix is minimal and surgical - only adding the missing charset parameter to the existing Content-Type header without affecting any other functionality.
Fixes #101.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.