fix(kuma-dp): set prometheus content-type when returning metrics #4706
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.
Summary
kuma-dp
scrapes metrics from the applications, aggregates them, and returns. Unfortunately we were not setting correctcontent-type
and some applications could file while scraping. Added setting of content type based on https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#basic-info. Also, added passing of prometheus requests header to the application. based on the code (https://github.com/prometheus/prometheus/blob/main/scrape/scrape.go#L772)Checklist prior to review
- [ ] Link to docs PR or issue--- [ ] Link to UI issue or PR--- [ ] Unit Tests--- [ ] Do you need to update--UPGRADE.md
?- [ ] Does it need to be backported according to the backporting policy?--