Skip to content

Last batch of library readmes#14832

Merged
laurit merged 3 commits into
open-telemetry:mainfrom
jaydeluca:library-readme-last-batch
Oct 2, 2025
Merged

Last batch of library readmes#14832
laurit merged 3 commits into
open-telemetry:mainfrom
jaydeluca:library-readme-last-batch

Conversation

@jaydeluca

Copy link
Copy Markdown
Member

Closes #6947

@jaydeluca jaydeluca requested a review from a team as a code owner September 29, 2025 18:06
@github-actions github-actions Bot added the test native This label can be applied to PRs to trigger them to run native tests label Sep 29, 2025
public class SpringKafkaConfiguration {

// Use this ContainerCustomizer to add interceptors to your Kafka listener containers.
public ContainerCustomizer<String, String, ConcurrentMessageListenerContainer<String, String>>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

an alternative would be to use spring annotations like in

@Configuration
public static class KafkaInstrumentationConfig {
@Bean
public DefaultKafkaProducerFactoryCustomizer producerInstrumentation() {
KafkaTelemetry kafkaTelemetry = KafkaTelemetry.create(testing.getOpenTelemetry());
return producerFactory -> producerFactory.addPostProcessor(kafkaTelemetry::wrap);
}
@Bean
public ContainerCustomizer<String, String, ConcurrentMessageListenerContainer<String, String>>
listenerCustomizer() {
SpringKafkaTelemetry springKafkaTelemetry =
SpringKafkaTelemetry.create(testing.getOpenTelemetry());
return container -> {
container.setRecordInterceptor(springKafkaTelemetry.createRecordInterceptor());
container.setBatchInterceptor(springKafkaTelemetry.createBatchInterceptor());
};
}
}
but I think it is fine this way too. Note that in the above snippet there is a separate producerInstrumentation. Would that be needed too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i think it makes sense to make it more spring-specific, so i've updated it. also added a producer example too

@laurit laurit merged commit 41c7bcd into open-telemetry:main Oct 2, 2025
91 checks passed
mznet pushed a commit to mznet/opentelemetry-java-instrumentation that referenced this pull request Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation for library instrumentations

2 participants