Skip to content

Update assemblies and modules Docs for Metrics Reporter integration #11329

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

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

Conversation

OwenCorrigan76
Copy link
Contributor

Type of change

  • Documentation

Description

With newly added support for the Strimzi Metrics Reporter to Kafka brokers/controllers components, this PR updates the assemblies and modules documents to reflect the changes in the way we can deploy metrics to the Kafka brokers and controllers.

Updates:

  • Example metrics files
  • Example grafana dashboards – mentioning metrics reporter-specific grafana dashboards

Structure for new content:

  • Assembly file: Using Metrics Reporter with Strimzi
  • Procedure file: Enabling Metrics Reporter
  • Reference file: Example Metrics Reporter configuration

Related to #11051

Checklist

Please go through this checklist and make sure all applicable tasks have been done

  • Write tests
  • Make sure all tests pass
  • Update documentation
  • Check RBAC rights for Kubernetes / OpenShift roles
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally
  • Reference relevant issue(s) and close them after merging
  • Update CHANGELOG.md
  • Supply screenshots for visual changes, such as Grafana dashboards

spec:
kafka:
# ...
metricsConfig: <1>
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no reference for <1>. Is it really needed?

@fvaleri fvaleri requested review from PaulRMellor and a team April 8, 2025 08:20
@fvaleri fvaleri added this to the 0.46.0 milestone Apr 8, 2025
├── kafka-cruise-control-metrics.yaml <14>
├── kafka-metrics.yaml <15>
├── kafka-mirror-maker-2-metrics.yaml <16>
└── oauth-metrics.yaml <17>
Copy link
Member

Choose a reason for hiding this comment

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

a couple of questions here:

  • aren't we getting examples for all the other components (apart Kafka) for using the Strimzi Metrics reporter?
  • wouldn't be better to put the Prometheus JMX exporter related example in a dedicated folder now that we have the strimzi-metrics-reporter one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ppatierno Is this the structure you're recommending?

├── metrics
|     ├── prometheus JMX exporter
|        └──── grafana-dashboards
|        └──── kafka-bridge-metrics.yaml 
|        └──── kafka-connect-metrics.yaml 
|        └──── kafka-cruise-control-metrics.yaml 
|        └──── kafka-metrics.yaml 
|        └──── kafka-mirror-maker-2-metrics.yaml 
|        └──── oauth-metrics.yaml 
|     ├── strimzi-metrics-reporter
|         └────grafana-dashboards
|         └──── kafka-metrics.yaml 
|         └──── README.md

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that was the idea thanks @OwenCorrigan76
@fvaleri @PaulRMellor wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, but the folder name should be prometheus-jmx-exporter and we need a similar README.md for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I'll update this docs PR and then update the main integration PR. Thanks

@OwenCorrigan76 OwenCorrigan76 force-pushed the Docs_for_integrate_metrics_reporter branch from e5596ab to 9fe4d31 Compare April 10, 2025 12:42
Copy link
Contributor

@PaulRMellor PaulRMellor left a comment

Choose a reason for hiding this comment

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

Looking good, Owen.
I left some suggestions.
There's a bit of overlap with a PR I'm about to merge in, which I've pointed out.
I also left a note on Kafka Exporter -- I've made a note to do something about that when we get these updates merged in

<8> PodMonitor definitions translated by the Prometheus Operator into jobs for the Prometheus server to be able to scrape metrics data directly from pods.
<9> Example Grafana dashboards to be used with Metrics Reporter for the Kafka component.
<10> Resource for deploying and configuring Kafka with Strimzi Metrics Reporter.
<11> Example Grafana dashboards for the different Strimzi components.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<11> Example Grafana dashboards for the different Strimzi components.
<11> Grafana dashboards for components using the JMX Reporter.

Comment on lines 34 to 36
* xref:assembly-metrics-setup-{context}[Set up and deploy Prometheus to expose metrics]
* xref:proc-metrics-kafka-deploy-options-{context}[Deploy Kafka Exporter to provide additional metrics]
* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Deploy Kafka Exporter to provide additional metrics]
* xref:proc-metrics-grafana-dashboard-{context}[Use Grafana to present the Prometheus metrics]
Copy link
Contributor

Choose a reason for hiding this comment

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

I deleted this section in PR #11307
I don't think we need it here, so would revert the changes to this file

<6> Alerting rules examples for use with Prometheus Alertmanager (deployed with Prometheus).
<7> Installation resource file for the Prometheus image.
<8> PodMonitor definitions translated by the Prometheus Operator into jobs for the Prometheus server to be able to scrape metrics data directly from pods.
<9> Example Grafana dashboards to be used with Metrics Reporter for the Kafka component.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<9> Example Grafana dashboards to be used with Metrics Reporter for the Kafka component.
<9> Grafana dashboards for components using the Strimzi Metrics Reporter.


xref:proc-metrics-reporter-kafka-deploy-options-{context}[Enabling Strimzi Metrics Reporter through configuration]

Once the type is determined, using Prometheus with Strimzi, requires the following:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Once the type is determined, using Prometheus with Strimzi, requires the following:
After enabling metrics, you can integrate with Prometheus:

@@ -12,16 +12,23 @@ To expose metrics in Prometheus format, you add configuration to a custom resour
You must also make sure that the metrics are scraped by your monitoring stack.
Prometheus and Prometheus Alertmanager are used in the examples provided by Strimzi, but you can use also other compatible tools.

Using Prometheus with Strimzi, requires the following:
You can enable either Prometheus JMX Exporter or Strimzi Metrics Reporter to expose metrics:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You can enable either Prometheus JMX Exporter or Strimzi Metrics Reporter to expose metrics:
You can expose metrics using one of the following approaches:

It is a good starting point for trying Prometheus with Strimzi.

This procedure shows how to deploy example Prometheus metrics configuration in the `Kafka` resource.
The process is the same when deploying the example files for other resources.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The process is the same when deploying the example files for other resources.

Copy link
Contributor

Choose a reason for hiding this comment

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

we include a note/cross-ref on how to configure the Kafka Exporter as well in the JMX procedure. Do we want it here too?

Lines 28-31: https://github.com/strimzi/strimzi-kafka-operator/pull/11307/files#diff-80eda6a9cce800533455d246c9b923ba06d53ea83645996177b63b5ef4f33e66R28-R31

Or maybe that needs to be separated from both now, so we link from each of these procedures. Note taken

@@ -29,7 +29,7 @@ When accessing a dashboard, you can use the `port-forward` command to forward tr
The name of the Grafana pod is different for each user.

.Prerequisites
* xref:proc-metrics-kafka-deploy-options-{context}[Metrics are configured for the Kafka cluster resource]
* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Metrics are configured for the Kafka cluster resource]
Copy link
Contributor

Choose a reason for hiding this comment

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

should we have links for both options here as an either/or?


[id='ref-jmx-metrics-prometheus-metrics-config-{context}']

= Example Prometheus Jmx Exporter metrics configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
= Example Prometheus Jmx Exporter metrics configuration
= Example Prometheus JMX Exporter metrics configuration

A label is a name-value pair.
Relabeling is the process of writing a label dynamically.
For example, the value of a label may be derived from the name of a Kafka server and client ID.
Strimzi uses the {StrimziMetricsReporter} or the {JMXExporter} to expose metrics through an HTTP endpoint, which can be scraped by the Prometheus server.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this file is worth having for two sentences?
Maybe we can just add to the intro of the example metrics file section?

@@ -42,6 +42,7 @@
//Monitoring links
:GrafanaHome: link:https://grafana.com/[Grafana Labs^]
:JMXExporter: link:https://github.com/prometheus/jmx_exporter[Prometheus JMX Exporter^]
:StrimziMetricsReporter: link:https://github.com/strimzi/metrics-reporter[Strimzi Metrics Reporter^]
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to link to this? We only use the link in one place. Maybe we can live without it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's another place that we should be linking to this, I've added a comment there, so maybe we should keep this?

@OwenCorrigan76 OwenCorrigan76 force-pushed the Docs_for_integrate_metrics_reporter branch from 99e88b1 to 8fa4e37 Compare April 11, 2025 12:27
@katheris
Copy link
Contributor

@OwenCorrigan76 should this PR be held until #11051 is ready?

@OwenCorrigan76
Copy link
Contributor Author

OwenCorrigan76 commented Apr 14, 2025

@katheris Correct. This should not be merged until #11051 is merged. Thanks

@ppatierno ppatierno modified the milestones: 0.46.0, 0.47.0 Apr 14, 2025
@fvaleri fvaleri requested a review from PaulRMellor April 15, 2025 09:15
Copy link
Contributor

@PaulRMellor PaulRMellor left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments, Owen.
Just a couple of minor suggestions, but looks good to me.
As discussed, I'll do something with the kafka exporter content when merged in

<13> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for Kafka.
<14> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for MirrorMaker 2.
<15> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for OAuth 2.0.
<10> Example Grafana dashboards with Metrics Reporter for the Kafka component.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<10> Example Grafana dashboards with Metrics Reporter for the Kafka component.
<10> Grafana dashboards for components using the Metrics Reporter.

├── kafka-cruise-control-metrics.yaml <14>
├── kafka-metrics.yaml <15>
├── kafka-mirror-maker-2-metrics.yaml <16>
└── oauth-metrics.yaml <17>

--
<1> Example Grafana dashboards for the different Strimzi components.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<1> Example Grafana dashboards for the different Strimzi components.
<1> Grafana dashboards for components using the JMX Exporter.

[id='proc-metrics-kafka-deploy-options-{context}']
= Enabling Prometheus metrics through configuration
[id='proc-jmx-exporter-metrics-kafka-deploy-options-{context}']
= Enabling Prometheus Jmx Exporter
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
= Enabling Prometheus Jmx Exporter
= Enabling Prometheus JMX Exporter

// metrics/assembly_metrics-kafka.adoc

[id='proc-metrics-reporter-kafka-deploy-options-{context}']
= Enabling Strimzi Metrics Reporter metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need metrics on the end or can we match with the JMX Exporter title: "Enabling Strimzi Metrics Reporter "

Comment on lines 17 to 19
xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus Jmx Exporter]

xref:proc-metrics-reporter-kafka-deploy-options-{context}[Enabling Strimzi Metrics Reporter]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus Jmx Exporter]
xref:proc-metrics-reporter-kafka-deploy-options-{context}[Enabling Strimzi Metrics Reporter]
* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus Jmx Exporter]
* xref:proc-metrics-reporter-kafka-deploy-options-{context}[Enabling Strimzi Metrics Reporter]

Copy link
Contributor

Choose a reason for hiding this comment

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

bullets

@OwenCorrigan76 OwenCorrigan76 force-pushed the Docs_for_integrate_metrics_reporter branch from 8fa4e37 to f0e747f Compare April 17, 2025 08:25
@OwenCorrigan76
Copy link
Contributor Author

Thanks a mil @PaulRMellor. I've addressed those latest comments. Hopefully we can merge as soon as the integration PR is merged.

Copy link
Contributor

@katheris katheris left a comment

Choose a reason for hiding this comment

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

Generally looks good to me, but I added a few comments that should be addressed

Using Prometheus with Strimzi, requires the following:
You can expose metrics using one of the following approaches:

* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus Jmx Exporter]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus Jmx Exporter]
* xref:proc-jmx-exporter-metrics-kafka-deploy-options-{context}[Enabling Prometheus JMX Exporter]


NOTE: The Prometheus JMX Exporter collects Java Management Extensions (JMX) from Kafka components and converts them into Prometheus metrics.
You do not require `jmxOptions` configuration in the custom resource of the component for the Prometheus JMX Exporter to function.
`jmxOptions` is only required if you need direct access to JMX from Kafka components.

//Example Prometheus metrics files
include::../../modules/metrics/ref-prometheus-metrics-config.adoc[leveloffset=+1]
Strimzi uses the StrimziMetricsReporter or the {JMXExporter} to expose metrics through an HTTP endpoint, which can be scraped by the Prometheus server.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should Strimzi Metrics Reporter also have a link?

Suggested change
Strimzi uses the StrimziMetricsReporter or the {JMXExporter} to expose metrics through an HTTP endpoint, which can be scraped by the Prometheus server.
Strimzi uses the {StrimziMetricsReporter} or the {JMXExporter} to expose metrics through an HTTP endpoint, which can be scraped by the Prometheus server.

@@ -42,6 +42,7 @@
//Monitoring links
:GrafanaHome: link:https://grafana.com/[Grafana Labs^]
:JMXExporter: link:https://github.com/prometheus/jmx_exporter[Prometheus JMX Exporter^]
:StrimziMetricsReporter: link:https://github.com/strimzi/metrics-reporter[Strimzi Metrics Reporter^]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's another place that we should be linking to this, I've added a comment there, so maybe we should keep this?

<13> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for Kafka.
<14> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for MirrorMaker 2.
<15> Metrics configuration that defines Prometheus JMX Exporter relabeling rules for OAuth 2.0.
<10> Grafana dashboards for components using the Metrics Reporter.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<10> Grafana dashboards for components using the Metrics Reporter.
<10> Grafana dashboards for components using the Strimzi Metrics Reporter.

@OwenCorrigan76 OwenCorrigan76 force-pushed the Docs_for_integrate_metrics_reporter branch from f0e747f to f1ca3be Compare April 22, 2025 15:19
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.

6 participants