-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 to Kafka brokers/controllers components #11051
base: main
Are you sure you want to change the base?
Add support for the Strimzi Metrics Reporter to Kafka brokers/controllers components #11051
Conversation
e569be2
to
1180ee2
Compare
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 left some comments after an initial pass. You should also update the names / description / CHANGELOG to make it clear what this really does. Kafka compoenents are brokers/controllers, Connect and MM2. You add this only for brokers/controllers. It should be clear from the CHANGELOG and PR name / desc.
CHANGELOG.md
Outdated
@@ -6,6 +6,7 @@ | |||
* Support for MirrorMaker 1 has been removed | |||
* Added support to configure `dnsPolicy` and `dnsConfig` using the `template` sections. | |||
* Store Kafka node certificates in separate Secrets, one Secret per pod. | |||
* Added support for Strimzi Metrics Reporter to the Kafka component. |
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.
What Kafka component?
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.
Thanks for the feedback @scholzj. I will address this.
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 don't think this makes really sense. It is over complicated, makes it harder to maintain the dashboards and probably makes it harder to use them as well. Just create separate dashboards in a subdirectory for the metrics reporter.
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.
Ok, I will create separate dashboards as requested.
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.
Same as above. Also, I guess Connect and MM2 dashboards are missing? Why?
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.
Connect and MM2 dashboards will be created in subsequent PRs, as we have only allowed for Kafka brokers and controllers in the PR.
@@ -62,7 +62,8 @@ public class KafkaClusterSpec implements HasConfigurableMetrics, HasConfigurable | |||
+ "cruise.control.metrics.topic, cruise.control.metrics.reporter.bootstrap.servers, " | |||
+ "node.id, process.roles, controller., metadata.log.dir, zookeeper.metadata.migration.enable, " // KRaft options | |||
+ "client.quota.callback.static.kafka.admin., client.quota.callback.static.produce, client.quota.callback.static.fetch, " | |||
+ "client.quota.callback.static.storage.per.volume.limit.min.available., client.quota.callback.static.excluded.principal.name.list"; | |||
+ "client.quota.callback.static.storage.per.volume.limit.min.available., client.quota.callback.static.excluded.principal.name.list, " | |||
+ "kafka.metric.reporters, prometheus.metrics.reporter."; |
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.
Why are we disabling kafka.metric.reporters
? What if someone uses it? If we want to disable it, it is definitely worth adding to CHANGELOG. But maybe it should be kept configurable?
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.
The naming here is a little unfortunate. We are not disabling metric.reporters
but we are locking down kafka.metrics.reporters
as the proposal requests. metric.reporters
is a Kafka config that is configurable but kafka.metrics.reporters
is a Reporter config that is not configurable.
@@ -67,7 +67,7 @@ public static Map<String, String> generateMetricsAndLogConfigMapData(Reconciliat | |||
data.put(supportsLogging.logging().configMapKey(), supportsLogging.logging().loggingConfiguration(reconciliation, metricsAndLogging.loggingCm())); | |||
} | |||
|
|||
if (model instanceof SupportsMetrics supportMetrics) { | |||
if (model instanceof SupportsMetrics supportMetrics && supportMetrics.metrics() != null) { |
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.
Why do we need this?
@@ -394,7 +405,8 @@ public Deployment generateDeployment(Map<String, String> annotations, boolean is | |||
protected List<EnvVar> getEnvVars() { | |||
List<EnvVar> varList = new ArrayList<>(); | |||
|
|||
varList.add(ContainerUtils.createEnvVar(ENV_VAR_CRUISE_CONTROL_METRICS_ENABLED, String.valueOf(metrics.isEnabled()))); | |||
String jmxMetricsEnabled = jmxExporterMetrics != null && jmxExporterMetrics.isEnabled() ? Boolean.TRUE.toString() : Boolean.FALSE.toString(); |
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.
Maybe you can inline this?
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.
Will do
private MetricsModel jmxExporterMetrics; | ||
private StrimziMetricsReporterModel strimziMetricsReporter; |
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.
We have MetricsModel for a reason. We should try to unify both metrics types into a single class (e.g. have MetricsModel as abstract class or interface and then two implementations for the different metric types).
@@ -286,7 +306,6 @@ public KafkaBrokerConfigurationBuilder withListeners( | |||
//////////////////// | |||
// Shared configurations with values dependent on all listeners | |||
//////////////////// | |||
|
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.
This is intentional here. Separates unrelated comments.
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.
Clumsy error. Will fix
/** | ||
* The configuration field name for Kafka metric reporters. | ||
*/ | ||
public static final String KAFKA_METRIC_REPORTERS_CONFIG_FIELD = "metric.reporters"; |
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.
It is not even used here. So why is it defined here?
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 defined it here because this is where the other Kafka config variables were defined. I will move it into the class where it is used and make it private.
This patch adds support for the Strimzi Metrics Reporter to brokers and controllers as described by the following proposal: https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md Signed-off-by: ocorriga <[email protected]>
Signed-off-by: ocorriga <[email protected]>
1180ee2
to
f943007
Compare
@scholzj I am currently working on the changes I did not comment on yet. |
Signed-off-by: ocorriga <[email protected]>
Signed-off-by: ocorriga <[email protected]>
Signed-off-by: Federico Valeri <[email protected]>
Type of change
Description
This patch adds support for the Strimzi Metrics Reporter to Kafka brokers/controllers components as described by the following proposal:
https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md
Related to #10753
Support for Kafka Connect and MirrorMaker2 will be added in subsequent PRs.
Checklist