-
Notifications
You must be signed in to change notification settings - Fork 121
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 Strimzi Metrics Reporter #954
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,16 @@ | ||||||
#Bridge related settings | ||||||
bridge.id=my-bridge | ||||||
|
||||||
# uncomment the following line to enable JMX Prometheus Exporter, check the documentation for more details | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
#bridge.metrics=jmxPrometheusExporter | ||||||
# optionally, you can set the file path of your custom configuration | ||||||
#bridge.metrics.exporter.config.path=/path/to/my-exporter-config.yaml | ||||||
|
||||||
# uncomment the following line to enable Strimzi Metrics Reporter, check the documentation for more details | ||||||
#bridge.metrics=strimziMetricsReporter | ||||||
fvaleri marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
# optionally, you can filter the exposed metrics using a comma separated list of regexes | ||||||
#kafka.prometheus.metrics.reporter.allowlist=.* | ||||||
|
||||||
# uncomment the following line (bridge.tracing) to enable OpenTelemetry tracing, check the documentation for more details | ||||||
#bridge.tracing=opentelemetry | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,11 +8,13 @@ | |||||
[role="_abstract"] | ||||||
Configure a deployment of the Kafka Bridge using configuration properties. | ||||||
Configure Kafka and specify the HTTP connection details needed to be able to interact with Kafka. | ||||||
It is possible to enable metrics in Prometheus format with JMX Prometheus Exporter or Strimzi Metrics Reporter. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
You can also use configuration properties to enable and use distributed tracing with the Kafka Bridge. | ||||||
Distributed tracing allows you to track the progress of transactions between applications in a distributed system. | ||||||
|
||||||
NOTE: Use the `KafkaBridge` resource to configure properties when you are xref:overview-components-running-kafka-bridge-cluster-{context}[running the Kafka Bridge on Kubernetes]. | ||||||
|
||||||
include::modules/proc-configuring-kafka-bridge.adoc[leveloffset=+1] | ||||||
include::modules/proc-configuring-kafka-bridge-metrics.adoc[leveloffset=+1] | ||||||
include::modules/proc-configuring-kafka-bridge-tracing.adoc[leveloffset=+1] | ||||||
include::modules/proc-configuring-kafka-bridge-jmx-metrics.adoc[leveloffset=+1] | ||||||
include::modules/proc-configuring-kafka-bridge-smr-metrics.adoc[leveloffset=+1] | ||||||
include::modules/proc-configuring-kafka-bridge-tracing.adoc[leveloffset=+1] |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,33 @@ | ||||||
[id='proc-configuring-kafka-bridge-jmx-metrics-{context}'] | ||||||
fvaleri marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
= Configuring JMX Exporter metrics | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
[role="_abstract"] | ||||||
Enable metrics for the Kafka Bridge by setting the `bridge.metrics` configuration. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is weirdly specific and unspecific. I would:
Suggested change
|
||||||
|
||||||
.Prerequisites | ||||||
|
||||||
* xref:proc-downloading-kafka-bridge-{context}[The Kafka Bridge installation archive is downloaded]. | ||||||
|
||||||
.Procedure | ||||||
|
||||||
. Set the `bridge.metrics` configuration to `jmxPrometheusExporter`. | ||||||
+ | ||||||
.Configuration for enabling metrics | ||||||
|
||||||
[source,properties] | ||||||
---- | ||||||
bridge.metrics=jmxPrometheusExporter | ||||||
---- | ||||||
+ | ||||||
Optionally, you can set a custom JMX Exporter configuration using the `bridge.metrics.exporter.config.path` property. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
If not set, a default embedded configuration file will be used. | ||||||
|
||||||
. Run the Kafka Bridge script to enable metrics. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't really enable metrics with this. You just start the bridge with the confguration.
Suggested change
|
||||||
+ | ||||||
.Running the Kafka Bridge to enable metrics | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above - You don't really enable metrics with this. You just start the bridge with the confguration.
Suggested change
|
||||||
[source,shell] | ||||||
---- | ||||||
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties | ||||||
---- | ||||||
+ | ||||||
With metrics enabled, you can use `GET /metrics` with the `/metrics` endpoint to retrieve Kafka Bridge metrics in Prometheus format. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[id='proc-configuring-kafka-bridge-smr-metrics-{context}'] | ||
fvaleri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
= Configuring Strimzi Metrics Reporter metrics | ||
|
||
[role="_abstract"] | ||
Enable metrics for the Kafka Bridge by setting the `bridge.metrics` configuration. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as for the Prometheus JMX Exporter procedure. |
||
|
||
.Prerequisites | ||
|
||
* xref:proc-downloading-kafka-bridge-{context}[The Kafka Bridge installation archive is downloaded]. | ||
|
||
.Procedure | ||
|
||
. Set the `bridge.metrics` configuration to `strimziMetricsReporter` and related configuration. | ||
+ | ||
.Configuration for enabling metrics | ||
|
||
[source,properties] | ||
---- | ||
bridge.metrics=strimziMetricsReporter | ||
---- | ||
+ | ||
Optionally, you can set a comma-separated list of regexes used to filter exposed metrics using the `kafka.prometheus.metrics.reporter.allowlist` property. | ||
If not set, all available metrics will be exposed. | ||
+ | ||
You can add any plugin configuration to the Bridge properties file using the `kafka.` prefix. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically, by using |
||
See the https://github.com/strimzi/metrics-reporter[Strimzi Metrics Reporter] documentation for more details. | ||
|
||
. Run the Kafka Bridge script to enable metrics. | ||
+ | ||
.Running the Kafka Bridge to enable metrics | ||
[source,shell] | ||
---- | ||
./bin/kafka_bridge_run.sh --config-file=<path>/application.properties | ||
---- | ||
+ | ||
With metrics enabled, you can use `GET /metrics` with the `/metrics` endpoint to retrieve Kafka Bridge metrics in Prometheus format. | ||
Comment on lines
+28
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comments as for the Prometheus JMX Exporter procedure. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,7 @@ | |
<checkstyle.version>10.12.2</checkstyle.version> | ||
<hamcrest.version>2.2</hamcrest.version> | ||
fvaleri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<junit.version>5.8.2</junit.version> | ||
<mockito.version>4.11.0</mockito.version> | ||
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version> | ||
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version> | ||
<maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version> | ||
|
@@ -131,6 +132,7 @@ | |
<spotbugs.version>4.7.3</spotbugs.version> | ||
<maven.spotbugs.version>4.7.3.0</maven.spotbugs.version> | ||
<strimzi-oauth.version>0.15.0</strimzi-oauth.version> | ||
<strimzi-metrics-reporter.version>0.1.0</strimzi-metrics-reporter.version> | ||
<opentelemetry.version>1.34.1</opentelemetry.version> | ||
<opentelemetry-alpha.version>1.34.1-alpha</opentelemetry-alpha.version> | ||
<opentelemetry.instrumentation.version>1.32.0-alpha</opentelemetry.instrumentation.version> | ||
|
@@ -295,6 +297,11 @@ | |
<artifactId>micrometer-registry-prometheus</artifactId> | ||
<version>${micrometer.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.strimzi</groupId> | ||
<artifactId>metrics-reporter</artifactId> | ||
<version>${strimzi-metrics-reporter.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.prometheus.jmx</groupId> | ||
<artifactId>collector</artifactId> | ||
|
@@ -305,6 +312,16 @@ | |
<artifactId>prometheus-metrics-model</artifactId> | ||
<version>${prometheus-client.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.prometheus</groupId> | ||
<artifactId>prometheus-metrics-instrumentation-jvm</artifactId> | ||
<version>${prometheus-client.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.prometheus</groupId> | ||
<artifactId>prometheus-metrics-exporter-httpserver</artifactId> | ||
<version>${prometheus-client.version}</version> | ||
</dependency> | ||
Comment on lines
+315
to
+324
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this included explicitly? |
||
<dependency> | ||
<groupId>io.prometheus</groupId> | ||
<artifactId>prometheus-metrics-exposition-textformats</artifactId> | ||
|
@@ -421,6 +438,12 @@ | |
<version>${hamcrest.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>${mockito.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.strimzi</groupId> | ||
<artifactId>strimzi-test-container</artifactId> | ||
|
@@ -584,6 +607,10 @@ | |
<!-- OpenTelemetry - used via classpath configuration opentelemetry-exporter-sender-grpc is required at runtime to replace OKHTTP --> | ||
<ignoredUnusedDeclaredDependency>io.grpc:grpc-netty-shaded:jar</ignoredUnusedDeclaredDependency> | ||
<ignoredUnusedDeclaredDependency>com.google.guava:guava</ignoredUnusedDeclaredDependency> | ||
<!-- Strimzi Metrics Reporter - used via classpath configuration --> | ||
<ignoredUnusedDeclaredDependency>io.strimzi:metrics-reporter</ignoredUnusedDeclaredDependency> | ||
<ignoredUnusedDeclaredDependency>io.prometheus:prometheus-metrics-instrumentation-jvm</ignoredUnusedDeclaredDependency> | ||
<ignoredUnusedDeclaredDependency>io.prometheus:prometheus-metrics-exporter-httpserver</ignoredUnusedDeclaredDependency> | ||
</ignoredUnusedDeclaredDependencies> | ||
</configuration> | ||
</execution> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think users really understand the JMX reference here and the use of JMX is actually completely internal to what it replaces.