-
Notifications
You must be signed in to change notification settings - Fork 123
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
Conversation
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've not looked at the code yet. I left comments trying to understand how this will be used.
a211d27
to
9385323
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 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.
I agree. @ppatierno wdyt? |
4a47979
to
4d87ff9
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 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)
4d87ff9
to
8b9e345
Compare
8b9e345
to
d0eedcd
Compare
ddabfb1
to
5084403
Compare
395ceda
to
01d1b74
Compare
@strimzi/maintainers proposal 92 has been accepted, and this PR is aligned, so open for review. Thanks. |
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
src/main/java/io/strimzi/kafka/bridge/http/converter/HttpTextMessageConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/io/strimzi/kafka/bridge/metrics/MetricsReporter.java
Outdated
Show resolved
Hide resolved
src/main/java/io/strimzi/kafka/bridge/metrics/StrimziCollectorRegistry.java
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
/** | ||
* @return the metric system to be used in the bridge | ||
*/ | ||
public String getMetrics() { |
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.
+1
src/main/java/io/strimzi/kafka/bridge/metrics/MetricsReporter.java
Outdated
Show resolved
Hide resolved
@ppatierno @scholzj your comments should be addressed, but there are a few open questions. For the new abstraction I used the |
@fvaleri can you resolve the conflicts before I have another pass please? |
8bc35ca
to
b7492ab
Compare
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
src/main/java/io/strimzi/kafka/bridge/http/converter/HttpTextMessageConverter.java
Outdated
Show resolved
Hide resolved
[INFO] --- spotbugs:4.7.3.0:check (default-cli) @ kafka-bridge ---
[INFO] BugInstance size is 3
[INFO] Error size is 0
[INFO] Total bugs: 3
[ERROR] Low: Private method io.strimzi.kafka.bridge.http.HttpBridge.contentTypeToFormat(String) is never called [io.strimzi.kafka.bridge.http.HttpBridge] At HttpBridge.java:[lines 644-652] UPM_UNCALLED_PRIVATE_METHOD
[ERROR] High: Found reliance on default encoding in io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter.toKafkaRecord(String, Integer, byte[]): String.getBytes() [io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter, io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter] At HttpTextMessageConverter.java:[line 46]Another occurrence at HttpTextMessageConverter.java:[line 53] DM_DEFAULT_ENCODING
[ERROR] High: Found reliance on default encoding in io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter.toMessages(ConsumerRecords): new String(byte[]) [io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter, io.strimzi.kafka.bridge.http.converter.HttpTextMessageConverter] At HttpTextMessageConverter.java:[line 104]Another occurrence at HttpTextMessageConverter.java:[line 105] DM_DEFAULT_ENCODING
I see these errors on the main branch too. Just tried with a fresh clone. |
Ok so I see another issue here. Our |
The CO build does not run spotbugs as part of the all target, do we want the Bridge to be different? I can still open a dedicated PR for the spotbugs fixes, but maybe without the all target change. Just let me know. Maybe it's the CI that should be modified to run |
Tbh I am confused now. The CO runs spotbugs as part of the Azure pipeline you are right but AFAICS it's the same for the bridge if you look at here https://github.com/strimzi/strimzi-kafka-bridge/blob/main/.azure/templates/jobs/build_java.yaml#L27 |
You do not have the sufficient number of approvals, so you cannot proceed with merging it regardless of what I think. |
I think you totally mislead what I meant. I just meant if you have anything to add which means review, leaving comments and/or approving. Then we can proceed. I wasn't going to merge without another approval, I know the rules. But because you reviewed this PR already I was just asking if you had anything more. |
Adding that even if any other maintainer would have approved it, I was anyway going to ask you if you had anything to add despite I had all the rights to merge. |
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
src/main/java/io/strimzi/kafka/bridge/metrics/MetricsCollector.java
Outdated
Show resolved
Hide resolved
6e5e782
to
11d996c
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.
LGTM. I left just one (hopefully last) nit. Thanks!
a6e0a77
to
5897639
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.
Few more nits and questions -> but nothing major anymore.
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
@fvaleri other than resolving the remaining comments could you also rebase please? We have the fix for the Travis CI pipeline in main now. Thanks! |
This patch adds support for metrics types configuration, integrating the Strimzi Metrics Reporter, and custom Prometheus JMX Exporter configuration. The custom configuration feature is needed for Cluster Operator integration, but it can also be leveraged by standalone users. See Proposal 43 for more details. Signed-off-by: Federico Valeri <[email protected]>
f9eea03
to
fcc70d4
Compare
Signed-off-by: Federico Valeri <[email protected]>
fcc70d4
to
d931a3b
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.
Thanks. LGTM.
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 Fede.
I left a few comments on the docs.
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 Prometheus JMX Exporter or Strimzi 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.
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 Prometheus JMX Exporter or Strimzi Metrics Reporter. | |
Configure a deployment of the Kafka Bridge with Kafka-related properties and specify the HTTP connection details needed to be able to interact with Kafka. | |
Additionally, enable metrics in Prometheus format using either the Prometheus JMX Exporter or the Strimzi 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.
Is there any difference/advantage to using one over the other that we should point out?
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.
There are, I'm adding links so users can find them easily and we don't need to update the doc.
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
@PaulRMellor thanks for the great suggestions. Let me know if there is still some doc improvement or issue. |
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 dressing the comments, Fede.
Just a few nits as I re-read.
documentation/modules/proc-configuring-kafka-bridge-jmx-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
documentation/modules/proc-configuring-kafka-bridge-smr-metrics.adoc
Outdated
Show resolved
Hide resolved
Signed-off-by: Federico Valeri <[email protected]>
87e3ed8
to
40b3c28
Compare
@fvaleri thanks again for your work! |
This patch adds support for metrics types configuration, integrating the Strimzi Metrics Reporter, and custom Prometheus JMX Exporter configuration. The custom configuration feature is needed for Cluster Operator integration, but it can also be leveraged by standalone users. See proposal 43 for more details.