quarkusio.github.io
quarkusio.github.io copied to clipboard
Should Custom ID Generator bean example be eagerly initialized
Describe the bug Should this example for setting up a custom id generator for OpenTelemetry with Quarkus be eagerly initialized?
@Singleton
public class CustomConfiguration {
/** Creates a custom IdGenerator for OpenTelemetry */
@Produces
@Singleton
public IdGenerator idGenerator() {
return AwsXrayIdGenerator.getInstance();
}
}
Should this be?
@Startup
@Singleton
public class CustomConfiguration {
/** Creates a custom IdGenerator for OpenTelemetry */
@Produces
@Singleton
public IdGenerator idGenerator() {
return AwsXrayIdGenerator.getInstance();
}
}
Alternative:
If we don't go with the eager initialization, should we advise in the documentation that the IdGenerator must be explicitly injected for it to be used?
Which pages https://quarkus.io/guides/opentelemetry#id-generator