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

support otel.instrumentation.kafka.experimental-span-attributes in spring starter #11263

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
Expand Down Expand Up @@ -111,6 +113,16 @@ public OpenTelemetry openTelemetry(
return autoConfiguredOpenTelemetrySdk.getOpenTelemetrySdk();
}

/**
* Expose the {@link ConfigProperties} bean for use in other auto-configurations.
*
* <p>Why not use spring boot properties directly? <br>
* 1. issues with older spring boot versions <br>
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't these issues affect our (broader) usage of spring boot properties to configure the SDK?

Copy link
Member

Choose a reason for hiding this comment

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

merging to unblock #11350, but i'd be in favor of removing this bullet (or explaining it better), since as written I think it creates more questions than it answers

Copy link
Member Author

@zeitlinger zeitlinger May 16, 2024

Choose a reason for hiding this comment

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

it's this style that silently returns false in boot 2

@Value("${otel.instrumentation.common.db-statement-sanitizer.enabled:true}")

https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/11350/files#diff-74d5efe463708e7c420646f0b1a8b490c76528e0abba9e8605f6f79bc73e1c40L33

Copy link
Member Author

Choose a reason for hiding this comment

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

wouldn't these issues affect our (broader) usage of spring boot properties to configure the SDK?

no

Copy link
Member

Choose a reason for hiding this comment

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

@zeitlinger

i'd be in favor of removing this bullet (or explaining it better), since as written I think it creates more questions than it answers

Suggested change
* 1. issues with older spring boot versions <br>

Copy link
Member

Choose a reason for hiding this comment

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

(i'll send PR)

* 2. support for {@link
* io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer#addPropertiesCustomizer(Function)}
* and {@link
* io.opentelemetry.sdk.autoconfigure.spi.AutoConfigurationCustomizer#addPropertiesSupplier(Supplier)}
*/
@Bean
public ConfigProperties otelProperties(
zeitlinger marked this conversation as resolved.
Show resolved Hide resolved
AutoConfiguredOpenTelemetrySdk autoConfiguredOpenTelemetrySdk) {
Expand Down
Loading