Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for customizing Prometheus request for metrics scraping by introducing PrometheusRequestHandler #213

Closed
swamymavuri opened this issue Mar 3, 2024 · 0 comments · Fixed by #220
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@swamymavuri
Copy link
Contributor

swamymavuri commented Mar 3, 2024

Describe the feature

This feature aims to enhance the customization options for Prometheus request handling by introducing the PrometheusRequestHandler. This handler provides users with the ability to define their own request handling strategies tailored to their application's needs, enabling greater flexibility and control over how Prometheus metrics are scraped and served.

Proposal:

The proposal involves adding support for customizing Prometheus request handling through the introduction of the PrometheusRequestHandler. This handler can be configured to scrape metrics from a PrometheusMeterRegistry and serve them over HTTP, offering various configuration options for metrics endpoints and the Prometheus registry.

Use cases

Enhanced Flexibility: Users can define custom request handling procedures tailored to their application's unique requirements by customizing registry.

Adaptability: By allowing users to define their own request handling logic, the feature promotes adaptability to diverse project environments and use cases.

Implementation Details

The implementation involves:

  • Introducing the PrometheusRequestHandler interface with factory methods for creating handlers.
  • Providing configuration options for specifying PrometheusMeterRegistry and metrics endpoints.
  • Implementing the PrometheusRequestHandlerImpl class to handle HTTP requests for Prometheus metrics scraping.

PrometheusMeterRegistry customRegistry = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT); customRegistry.config().namingConvention(NamingConvention.camelCase); router.route("/custom-metrics").handler(ctx -> PrometheusRequestHandler.create(customRegistry,"/custom-metrics") .handle(ctx.request()));

This feature enhancement will enrich the Prometheus integration in Vert.x, offering users greater flexibility and control over how metrics are handled and served.

Contribution

Who should implement this feature ? are you volunteering for implementing this feature - YES

@swamymavuri swamymavuri added the enhancement New feature or request label Mar 3, 2024
swamymavuri added a commit to swamymavuri/vertx-micrometer-metrics that referenced this issue Mar 3, 2024
swamymavuri added a commit to swamymavuri/vertx-micrometer-metrics that referenced this issue May 19, 2024
@tsegismont tsegismont added this to the 5.0.0 milestone May 21, 2024
@tsegismont tsegismont self-assigned this May 21, 2024
@swamymavuri swamymavuri changed the title Add support for custom exception handler for VertxPrometheusOptions Add support for customizing Prometheus request for metrics scraping by introducing PrometheusRequestHandler May 25, 2024
swamymavuri added a commit to swamymavuri/vertx-micrometer-metrics that referenced this issue May 25, 2024
…vertx-micrometer-metrics into feature/vert-x3#213

# Conflicts:
#	src/main/java/io/vertx/micrometer/backends/PrometheusBackendRegistry.java
@tsegismont tsegismont removed this from the 5.0.0 milestone May 27, 2024
@tsegismont tsegismont assigned tsegismont and unassigned tsegismont May 27, 2024
@tsegismont tsegismont added this to the 5.0.0 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants