-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for the Strimzi Metrics Reporter to Kafka brokers/controllers components #11051
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
Merged
ppatierno
merged 6 commits into
strimzi:main
from
OwenCorrigan76:integrate_metrics_reporter
May 16, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
45d3ef4
Add support for the Strimzi Metrics Reporter to brokers and controllers
OwenCorrigan76 0a026ff
Refactor to address Jmx Reporter change
OwenCorrigan76 6334ded
Improve tests in KafkaBrokerConfigurationBuilderTest
OwenCorrigan76 5ac7beb
Address comments from Jakub
OwenCorrigan76 ef34b6c
Fix testCreateOrAddListConfigWithNullConfig
OwenCorrigan76 2215a9b
Address nits
OwenCorrigan76 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
api/src/main/java/io/strimzi/api/kafka/model/common/metrics/StrimziMetricsReporter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Copyright Strimzi authors. | ||
| * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
| */ | ||
| package io.strimzi.api.kafka.model.common.metrics; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import io.strimzi.api.kafka.model.common.Constants; | ||
| import io.strimzi.crdgenerator.annotations.Description; | ||
| import io.sundr.builder.annotations.Buildable; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.ToString; | ||
|
|
||
| /** | ||
| * Strimzi Metrics Reporter. | ||
| */ | ||
| @Buildable( | ||
| editableEnabled = false, | ||
| builderPackage = Constants.FABRIC8_KUBERNETES_API | ||
| ) | ||
| @JsonPropertyOrder({"type", "values"}) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| @EqualsAndHashCode(callSuper = true) | ||
| @ToString(callSuper = true) | ||
| public class StrimziMetricsReporter extends MetricsConfig { | ||
| public static final String TYPE_STRIMZI_METRICS_REPORTER = "strimziMetricsReporter"; | ||
|
|
||
| private StrimziMetricsReporterValues values; | ||
|
|
||
| @Description("Must be `" + TYPE_STRIMZI_METRICS_REPORTER + "`") | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| @Override | ||
| public String getType() { | ||
| return TYPE_STRIMZI_METRICS_REPORTER; | ||
| } | ||
|
|
||
| @Description("Configuration values for the Strimzi Metrics Reporter.") | ||
| public StrimziMetricsReporterValues getValues() { | ||
| return values; | ||
| } | ||
|
|
||
| public void setValues(StrimziMetricsReporterValues values) { | ||
| this.values = values; | ||
| } | ||
| } |
57 changes: 57 additions & 0 deletions
57
...src/main/java/io/strimzi/api/kafka/model/common/metrics/StrimziMetricsReporterValues.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /* | ||
| * Copyright Strimzi authors. | ||
| * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
| */ | ||
| package io.strimzi.api.kafka.model.common.metrics; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
| import io.strimzi.api.kafka.model.common.Constants; | ||
| import io.strimzi.api.kafka.model.common.UnknownPropertyPreserving; | ||
| import io.strimzi.crdgenerator.annotations.Description; | ||
| import io.sundr.builder.annotations.Buildable; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.ToString; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| /** | ||
| * Strimzi Metrics Reporter configuration. | ||
| */ | ||
| @Buildable( | ||
| editableEnabled = false, | ||
| builderPackage = Constants.FABRIC8_KUBERNETES_API | ||
| ) | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| @JsonPropertyOrder({"allowList"}) | ||
| @EqualsAndHashCode | ||
| @ToString | ||
| public class StrimziMetricsReporterValues implements UnknownPropertyPreserving { | ||
ppatierno marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private List<String> allowList; | ||
| private Map<String, Object> additionalProperties; | ||
|
|
||
| @Description("A list of regex patterns to filter the metrics to collect. Should contain at least one element.") | ||
| @JsonInclude(value = JsonInclude.Include.NON_NULL) | ||
| public List<String> getAllowList() { | ||
| return allowList; | ||
| } | ||
|
|
||
| public void setAllowList(List<String> allowList) { | ||
| this.allowList = allowList; | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, Object> getAdditionalProperties() { | ||
| return this.additionalProperties != null ? this.additionalProperties : Map.of(); | ||
| } | ||
|
|
||
| @Override | ||
| public void setAdditionalProperty(String name, Object value) { | ||
| if (this.additionalProperties == null) { | ||
| this.additionalProperties = new HashMap<>(2); | ||
| } | ||
| this.additionalProperties.put(name, value); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.