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

Drop event bus message spans #3238

Merged
merged 2 commits into from
May 10, 2022
Merged

Conversation

calohmn
Copy link
Contributor

@calohmn calohmn commented May 6, 2022

Follow up of #3219:
With the new Quarkus version, traces for Vert.x event bus messages now get created (by means of EventBusInstrumenterVertxTracer). This means the adapter traces will now include traces like
notification.tenant-change-v1 send with notification.tenant-change-v1 receive child spans (and corresponding traces for device and credentials changes). And the device registry/command router will contain authentication.in send traces (with authentication.in receive child span).

These traces just represent an implementation detail on how notification messages and the authentication processing are handled and don't offer real value. Therefore, this PR drops these traces.

Note that the usage of TracingPolicy.IGNORE to prevent creation of such traces (as described in the Vert.x documentation) doesn't work with the current Quarkus version - see quarkusio/quarkus#25417.

@calohmn calohmn added the Tracing label May 6, 2022
@calohmn calohmn added this to the 2.0.0 milestone May 6, 2022
Comment on lines 56 to +59
// Suppression of these spans via "quarkus.opentelemetry.tracer.suppress-non-application-uris" doesn't work
// if the non-application-root-path is the same as the overall root path.
return new DropHttpRequestSpansSampler(sampler);
sampler = new DropHttpRequestSpansSampler(sampler);
// drop spans for the given event bus message prefixes
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we might want to actually use the non-application root path then. Given that we already decided that the 2.0.0 chart will not be backward compatible with Hono 1.x, I think that we could as well take advantage of the existing features then ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, we could do that. (The DropHttpRequestSpansSampler would still be needed though for now, as not only the non-application-root-path spans shall get dropped. Issue for the removal of that sampler is #3213.)
Changing the non-application-root-path and the healthcheck endpoints should be done in a separate PR then.

Copy link
Contributor

Choose a reason for hiding this comment

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

as not only the non-application-root-path spans shall get dropped.

Couldn't we simply remove the TracingHandler in favor of the standard functionality provided by the quarkus-opentelemetry extension?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is basically the goal of #3213 (see also #3205 (comment)).

It's a bit more than just removing the TracingHandler class. You mean including this in 2.0.0?
I began working on this but then stopped, waiting for the Quarkus update. I can have another look.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, if we want to use the non-application-root path for probes and metrics, then I think we should do it with 2.0.0. Not sure how this is related to getting rid of the TracingHandler, but if we can kill two birds with one stone, then I think we should do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In any case, this PR here is mostly about the event bus spans. I've only included a small fix for the DropHttpRequestSpansSampler regarding the Quarkus update (and the changed span names there).

Copy link
Contributor

Choose a reason for hiding this comment

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

Changing the non-application-root-path and the healthcheck endpoints should be done in a separate PR then.

I take it that we indeed want to change these paths with Hono 2.0.0 so that they include a non-empty non-application-root-path (e.g. q), right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With regards to the dropping of the healthcheck endpoint spans, the current Hono code is independent from the used non-application-root-path. As a custom sampler is needed in Hono (for using the SamplingPrioritySampler), dropping of these spans needs to be done manually anyway (until a solution for quarkusio/quarkus#25525 is implemented). So, mandating usage of the /q healthcheck endpoint prefix would only enable us to simplify the span-dropping logic a bit here.

In that sense, I have no strong view about switching to use the /q prefix. But I guess, as Quarkus is now used for all Hono components and we don't need Helm-chart backwards-compatibility here, we might as well stick to the Quarkus default paths.

Copy link
Contributor

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

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

LGTM

@calohmn calohmn merged commit cd7e3e4 into eclipse-hono:master May 10, 2022
@calohmn calohmn deleted the PR/drop_spans branch May 10, 2022 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants