Skip to content

Commit

Permalink
Backport part of hide EndUserSpanProcessor integration
Browse files Browse the repository at this point in the history
(partly cherry picked from commit a1f4fab)
  • Loading branch information
brunobat authored and gsmet committed Apr 11, 2024
1 parent 59aa294 commit e5045ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 0 additions & 4 deletions docs/src/main/asciidoc/opentelemetry.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,6 @@ public class CustomConfiguration {
}
----

==== User data

By setting `quarkus.otel.traces.eusp.enabled=true` you can add information about the user related to each span. The user's ID and roles will be added to the span attributes, if available.

[[sampler]]
=== Sampler
A https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampling[sampler] decides whether a trace should be discarded or forwarded, effectively managing noise and reducing overhead by limiting the number of collected traces sent to the collector.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.jboss.jandex.DotName;
import org.jboss.jandex.ParameterizedType;
import org.jboss.jandex.Type;
import org.jboss.logging.Logger;

import io.opentelemetry.sdk.trace.SpanProcessor;
import io.opentelemetry.sdk.trace.export.SpanExporter;
Expand All @@ -35,6 +36,8 @@
@BuildSteps(onlyIf = OtlpExporterProcessor.OtlpExporterEnabled.class)
public class OtlpExporterProcessor {

private static final Logger LOG = Logger.getLogger(OtlpExporterProcessor.class);

static class OtlpExporterEnabled implements BooleanSupplier {
OtlpExporterBuildConfig exportBuildConfig;
OTelBuildConfig otelBuildConfig;
Expand All @@ -55,6 +58,8 @@ void createEndUserSpanProcessor(
buildProducer.produce(
AdditionalBeanBuildItem.unremovableOf(
EndUserSpanProcessor.class));
LOG.warn("End User Span tracking has been enabled by setting quarkus.otel.traces.eusp.enabled=true. Please " +
"AVOID using this feature in production with the current Quarkus version.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigDocIgnore;
import io.quarkus.runtime.annotations.ConfigGroup;
import io.smallrye.config.WithDefault;

Expand All @@ -18,6 +19,7 @@ public interface EndUserSpanProcessorConfig {
* the {@link io.opentelemetry.semconv.SemanticAttributes.ENDUSER_ID}
* and {@link io.opentelemetry.semconv.SemanticAttributes.ENDUSER_ROLE} to the Span.
*/
@ConfigDocIgnore
@WithDefault("false")
Optional<Boolean> enabled();

Expand Down

0 comments on commit e5045ff

Please sign in to comment.