Skip to content
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

Configure kafka metrics reporter as class #10855

Merged
merged 5 commits into from Mar 14, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Mar 14, 2024

Resolves #10823
Resolves #9883

@laurit laurit marked this pull request as ready for review March 14, 2024 14:38
@laurit laurit requested a review from a team as a code owner March 14, 2024 14:38
@trask trask added this to the v2.2.0 milestone Mar 14, 2024
Comment on lines +141 to +147
@SuppressWarnings("unchecked")
private static Object mergeValue(Object o1, Object o2) {
List<Object> result = new MetricsReporterList<>();
result.addAll((List<Object>) o1);
result.add(o2);
return result;
}
Copy link
Member

Choose a reason for hiding this comment

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

I didn't follow why test needs to use the internal MetricsReporterList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we have a test that tries to serialize the configuration

and that test gets the configuration from this method. If we just use an ArrayList here then the configuration will contain the list that includes OpenTelemetryMetricsReporter.class which will fail in This is a bit convoluted, but the current behavior that depends on the thread context class loader being able to load the OpenTelemetryMetricsReporterTest isn't ideal either.

@laurit laurit merged commit 61ca213 into open-telemetry:main Mar 14, 2024
49 checks passed
@laurit laurit deleted the kafka-metrics-reporter-as-class branch March 14, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants