-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Enable providing custom OtlpHttpSpanExporter #35596
Comments
Some of the behaviors you described here are intentional: we wanted to allow additional This is also why we cannot really do this: I do have a couple of ideas:
|
One thing we could think about if we should introduce an abstraction which can veto that a @Bean
@ConditionalOnMissingBean
SdkTracerProvider otelSdkTracerProvider(Environment environment, ObjectProvider<SpanProcessor> spanProcessors,
Sampler sampler, ObjectProvider<SdkTracerProviderBuilderCustomizer> customizers,
SpanProcessorVetoer spanProcessorVetoer) {
String applicationName = environment.getProperty("spring.application.name", DEFAULT_APPLICATION_NAME);
SdkTracerProviderBuilder builder = SdkTracerProvider.builder()
.setSampler(sampler)
.setResource(Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, applicationName)));
spanProcessors.orderedStream().forEach((spanProcessor) -> {
if (!spanProcessorVetoer.veto(spanProcessor)) {
builder.addSpanProcessor(spanProcessor);
}
});
customizers.orderedStream().forEach((customizer) -> customizer.customize(builder));
return builder.build();
}
/**
* Can veto against adding a {@link SpanProcessor} to the {@link SdkTracerProvider}.
*/
interface SpanProcessorVetoer {
/**
* Returns {@code true} if veto against the given {@link SpanProcessor}, meaning
* that the span processor won't be added to the {@link SdkTracerProvider}.
* @param spanProcessor span processor which is under vote
* @return {@code true} if vetoed against the given span processor, {@code false}
* otherwise
*/
boolean veto(SpanProcessor spanProcessor);
} That would solve the problem with multiple |
Hi @jonatan-ivanov , Thanks for the quick response. Regarding option 3, the main reason why we override the Now regarding option 2 (and @mhalbritter proposal variant), the drawback is that the So I think that we are left only with option 1 because of the BWC concerns with the additivity behavior of the SpanProcessors. |
I think to me being able to extend @mhalbritter What do you think about introducing enable flags (maybe for zipkin too)? |
I'm not a big fan of those enabled flags, but if we don't find a better solution, maybe that's the pill we have to swallow. Maybe someone else from the team has a better idea, let's talk about that in our next meeting. |
I agree, it'd be useful, it is just hard to find a concrete use-case to justify this and dont have big expectations since OTel is very strict with their API surface. |
We discussed this today and one idea we're considering is to remove the default This would give us a strong signal about when we'd auto-configure an There are a couple of downsides to this approach. 1) It's a breaking change. 2) It makes configuration a little more verbose. |
In the meantime you could try adding |
Hi @philwebb, fair enough. You mean that you'll add a
Yeap, I was trying to avoid that because we provide our custom Thanks a lot everyone for the quick response. |
BTW, for our specific deployment, the OTLP Collector is running remotely, so even if we could stick to the stock |
The auto-configuration activates now only if |
If endpoint property is becoming mandatory for auto-configuring the exporter, IMO the auto-configuration shouldn't be limited to just supporting the HTTP exporter. |
You would like to see auto-configuration for |
Well, since the endpoint URL has to be provided now, it can be used to figure out which type of exporter the user wants to configure and also support the gRPC option. |
Created #35863 for it. |
Additionally to the property change, there's now a |
This issue was originally reported here: #34508 (comment) by @chicobento:
The text was updated successfully, but these errors were encountered: