Skip to content

Issue 2161: set metrics endpoint content-type#4208

Merged
eolivelli merged 6 commits into
apache:masterfrom
tomjo:metricsfix
Mar 18, 2024
Merged

Issue 2161: set metrics endpoint content-type#4208
eolivelli merged 6 commits into
apache:masterfrom
tomjo:metricsfix

Conversation

@tomjo

@tomjo tomjo commented Feb 9, 2024

Copy link
Copy Markdown
Contributor

Motivation

Fixes #2161

Changes

Add contentType to HttpServiceResponse and map it in VertxAbstractHandler which allows
MetricsService (which is used instead of PrometheusServlet when bookie http server is enabled) to set the http Content-Type header to the right value which allow successful scraping of the endpoint by e.g. New Relic

Master Issue: #2161

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomjo
tomjo requested a review from eolivelli March 6, 2024 07:49
@hangc0276

Copy link
Copy Markdown
Contributor

@eolivelli Would you please review this PR again? Thanks.

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

+1

@eolivelli
eolivelli merged commit 382184e into apache:master Mar 18, 2024
nicoloboschi pushed a commit that referenced this pull request Mar 21, 2024
* fix: set metrics endpoint content-type when bookie http server is enabled

* fix: checkstyle

* fix: use existing prometheus content type constant

* chore: use minimal dependency / license fixes

* Revert "chore: use minimal dependency / license fixes"

This reverts commit 7daf8be.

* Revert "fix: use existing prometheus content type constant"

This reverts commit c265c49.

(cherry picked from commit 382184e)
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
* fix: set metrics endpoint content-type when bookie http server is enabled

* fix: checkstyle

* fix: use existing prometheus content type constant

* chore: use minimal dependency / license fixes

* Revert "chore: use minimal dependency / license fixes"

This reverts commit 7daf8be.

* Revert "fix: use existing prometheus content type constant"

This reverts commit c265c49.
lhotari pushed a commit that referenced this pull request Nov 19, 2024
* fix: set metrics endpoint content-type when bookie http server is enabled

* fix: checkstyle

* fix: use existing prometheus content type constant

* chore: use minimal dependency / license fixes

* Revert "chore: use minimal dependency / license fixes"

This reverts commit 7daf8be.

* Revert "fix: use existing prometheus content type constant"

This reverts commit c265c49.

(cherry picked from commit 382184e)
@lhotari

lhotari commented Mar 5, 2025

Copy link
Copy Markdown
Member

Until this change is available, it's possible to configure fallbackScrapeProtocol in Prometheus at multiple levels. Here's an example for Apache Pulsar Helm chart apache/pulsar-helm-chart#577 .

lhotari pushed a commit that referenced this pull request Apr 17, 2025
* fix: set metrics endpoint content-type when bookie http server is enabled

* fix: checkstyle

* fix: use existing prometheus content type constant

* chore: use minimal dependency / license fixes

* Revert "chore: use minimal dependency / license fixes"

This reverts commit 7daf8be.

* Revert "fix: use existing prometheus content type constant"

This reverts commit c265c49.

(cherry picked from commit 382184e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When httpServerEnabled=true, Prometheus reports doesn't set content-type

8 participants