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

Opentelemetry NonApplicationEndpointSampler should consider http.root-path #20698

Closed
stefanorg opened this issue Oct 12, 2021 · 4 comments · Fixed by #22750
Closed

Opentelemetry NonApplicationEndpointSampler should consider http.root-path #20698

stefanorg opened this issue Oct 12, 2021 · 4 comments · Fixed by #22750
Assignees
Labels
area/tracing kind/bug Something isn't working
Milestone

Comments

@stefanorg
Copy link

Describe the bug

With open-telemetry extension installed and enabled, the default behaviour is to ignore non application uri suppress-non-application-uris: true

With the default sampler implementation at runtime we got aNonApplicationEndpointSampler instantiated.
The default implementation doesn't take in consideration the application context root

 @Override
    public SamplingResult shouldSample(Context parentContext, String traceId, String name, SpanKind spanKind,
            Attributes attributes, List<LinkData> parentLinks) {


// if context-root is myapplication, name will be myapplication/q/health/ready
// so this check will fail
        if (name.startsWith("q/") && spanKind == SpanKind.SERVER) {
            return NEGATIVE_SAMPLING_RESULT;
        }
        return root.shouldSample(parentContext, traceId, name, spanKind, attributes, parentLinks);
    }

Expected behavior

If my application context-root is myapplication every request under myapplication/q/* should be ignored by the sampler if suppress-non-application-uris is true

Actual behavior

Actually every check under myapplication/q/* get sampled.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@stefanorg stefanorg added the kind/bug Something isn't working label Oct 12, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 12, 2021

/cc @kenfinnigan

@kenfinnigan kenfinnigan self-assigned this Oct 13, 2021
@kenfinnigan kenfinnigan removed their assignment Oct 13, 2021
@radcortez radcortez self-assigned this Dec 23, 2021
@gsmet
Copy link
Member

gsmet commented Jan 5, 2022

@radcortez looks like one we could tackle easily and be done with?

@radcortez
Copy link
Member

Yes, the plan is to implement that. OTel is going to offer an API to disable selected endpoints, but we need to move to their config API, which is missing a few things for us to use properly. I'm discussing this with the OTel community, so we can add what is missing.

@radcortez
Copy link
Member

Thinking about this a little better, it may take a while for us to have OTel fully integrated to use their config for this. I'll probably just add it directly into Quarkus for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tracing kind/bug Something isn't working
Projects
None yet
4 participants