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

Ensure kafka configuration remains serializable #7754

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Feb 7, 2023

Resolves #7597
I wasn't able to reproduce this. Figuring out how to run beam, flink and kafka together feels like too much effort. Without reproducing it is too hard to tell why the configuration is serialized, but my hunch is that it is enough to ensure that the configuration can be serialized.

@laurit laurit requested a review from a team as a code owner February 7, 2023 08:26
@@ -75,7 +76,8 @@ public static void enhanceConfig(Map<? super String, Object> config) {
OpenTelemetryMetricsReporter.class.getName(),
(class1, class2) -> class1 + "," + class2);
config.put(
OpenTelemetryMetricsReporter.CONFIG_KEY_OPENTELEMETRY_INSTANCE, GlobalOpenTelemetry.get());
OpenTelemetryMetricsReporter.CONFIG_KEY_OPENTELEMETRY_SUPPLIER,
new OpenTelemetrySupplier(GlobalOpenTelemetry.get()));
Copy link
Member

Choose a reason for hiding this comment

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

can we use a supplier here that always returns GlobalOpenTelemetry.get()? that way it will "actually be serializable" in case that's a real thing for kafka config 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is also the library instrumentation where there is no way to restore the OpenTelemetry instance. I thought that we can let the reporter of this issue test it. If it is needed then he'll get a NPE and we'll know that we have to do something for both javaagent and library instrumentation.

@laurit laurit merged commit 5d18255 into open-telemetry:main Feb 9, 2023
@laurit laurit deleted the kafka-serializable branch February 9, 2023 06:45
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.

Flink with auto instrumentation throws NotSerializableException on GlobalOpenTelemetry$ObfuscatedOpenTelemetry
3 participants