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 the Strimzi Metrics Reporter #954

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fvaleri
Copy link

@fvaleri fvaleri commented Dec 17, 2024

This patch adds support for the Strimzi Metrics Reporter.

Setting bridge.metrics=jmxPrometheusExporter enables the JMX Prometheus Exporter (equivalent to KAFKA_BRIDGE_METRICS_ENABLED=true). Setting bridge.metrics=strimziMetricsReporter enables the new Strimzi Metrics Reporter as Kafka plugin.

When selecting the strimziMetricsReporter, you also need to add the plugin configuration as in the following example:

bridge.metrics=strimziMetricsReporter
kafka.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
kafka.prometheus.metrics.reporter.listener.enable=false
kafka.prometheus.metrics.reporter.allowlist=.*

See strimzi/proposals#143 for more details.

@fvaleri fvaleri requested a review from ppatierno December 17, 2024 09:26
@fvaleri
Copy link
Author

fvaleri commented Dec 17, 2024

@OwenCorrigan76 @mimaison fyi

Copy link

@mimaison mimaison left a comment

Choose a reason for hiding this comment

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

I've not looked at the code yet. I left comments trying to understand how this will be used.

#bridge.metrics=jmxPrometheusExporter

# uncomment the following lines to enable Strimzi Reporter metrics, check the documentation for more details
#bridge.metrics=strimziMetricsReporter

Choose a reason for hiding this comment

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

From a configuration standpoint I would expect that users would just need to set bridge.metrics=strimziMetricsReporter and maybe the allowlist and not set the other individual configurations kafka.prometheus.metrics.reporter.listener.enable, kafka.metric.reporters.

Copy link
Author

Choose a reason for hiding this comment

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

This is how it will work when using the Cluster Operator. Talking with @ppatierno, we agreed that, for the standalone Bridge, the user should be free to set all configurations through the properties file.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. When bridge is running on bare metal / VM, it's the user to provide the application.properties file for the bridge with its configuration. The bridge doesn't have to change the properties file in any way enforcing other parameters which the user didn't set.

Copy link
Member

@scholzj scholzj left a comment

Choose a reason for hiding this comment

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

I wonder if this should go through a dedicated proposal first. The original proposal - https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md - sadly didn't cover the bridge in sufficient depth and there will be some backward compatibility impact here or in the operators repo that needs to be carefully considered. A proposal would be the right place to discuss it and decide on the best approach.

@fvaleri
Copy link
Author

fvaleri commented Dec 17, 2024

there will be some backward compatibility impact here or in the operators repo that needs to be carefully considered

I agree. Probably the backwards incompatible changes are mostly on the operator side, where we have to introduce metricsConfig at the CRD level. @ppatierno wdyt?

Copy link
Member

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

I left just some minor comments but I will review it again when the proposal is accepted (to avoid reviewing now something that will be changed later by the final proposal)

#bridge.metrics=jmxPrometheusExporter

# uncomment the following lines to enable Strimzi Reporter metrics, check the documentation for more details
#bridge.metrics=strimziMetricsReporter
Copy link
Member

Choose a reason for hiding this comment

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

Yeah. When bridge is running on bare metal / VM, it's the user to provide the application.properties file for the bridge with its configuration. The bridge doesn't have to change the properties file in any way enforcing other parameters which the user didn't set.

CHANGELOG.md Outdated Show resolved Hide resolved
pom.xml Show resolved Hide resolved
pom.xml Outdated Show resolved Hide resolved
This patch adds support for the Strimzi Metrics Reporter.

Setting `bridge.metrics=jmxPrometheusExporter` enables the JMX Prometheus Exporter (equivalent to KAFKA_BRIDGE_METRICS_ENABLED=true).
Setting `bridge.metrics=strimziMetricsReporter` enables the new Strimzi Metrics Reporter as Kafka plugin.

When selecting the `strimziMetricsReporter`, you also need to add the plugin configuration as in the following example:

```sh
bridge.metrics=strimziMetricsReporter
kafka.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
kafka.prometheus.metrics.reporter.listener.enable=false
kafka.prometheus.metrics.reporter.allowlist=.*
```

Signed-off-by: Federico Valeri <[email protected]>
Signed-off-by: Federico Valeri <[email protected]>
Signed-off-by: Federico Valeri <[email protected]>
Implementation of "Integrate Bridge with Metrics Reporter" proposal.

Signed-off-by: Federico Valeri <[email protected]>
Signed-off-by: Federico Valeri <[email protected]>
@fvaleri fvaleri force-pushed the bridge-metrics-rep branch from 8b9e345 to d0eedcd Compare January 2, 2025 08:04
@fvaleri fvaleri added this to the 0.32.0 milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants