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

Fix inconsistent behavior for quarkus.jaeger.reporter-log-spans between native/non-native #18346

Closed
christian-morin opened this issue Jul 2, 2021 · 2 comments · Fixed by #18406
Labels
area/jaeger kind/enhancement New feature or request
Milestone

Comments

@christian-morin
Copy link
Contributor

christian-morin commented Jul 2, 2021

Description

When enabling the log-span reporter for jaeger, the sent spans are reported, but the behaviour differs between native/non-native builds.

When running in java-mode, the LoggingReporter from Jaeger-client is used: https://github.com/jaegertracing/jaeger-client-java/blob/master/jaeger-core/src/main/java/io/jaegertracing/internal/reporters/LoggingReporter.java. It produces the following log-output:

2021-07-01 11:36:17.890  INFO 57947 --- [vert.x-worker-t] io.ja.in.re.LoggingReporter : Span reported: 79849c0ae5afa2ef:dbf5e2379cd593e:79849c0ae5afa2ef:1 - GET

But when running in native-mode:

--- not logging: f2c37d78d475ccf4:acd21ae452e05d6d:e751e2cdb1c44646:1 - GET

This is because the https://github.com/quarkusio/quarkus/blob/main/extensions/jaeger/runtime/src/main/java/io/quarkus/jaeger/runtime/graal/Target_LoggingReporter.java is used, which simply writes to stderr instead of a proper log.

@Substitute
    @Override
    public void report(JaegerSpan span) {
        System.err.println("--- not logging: " + span);
    }

Is there a reason for it not simply using a org.jboss.logging.Logger for this, in order to get a proper log instead?

Sorry if this might be an obvious limitation and there's nothing that can be done in regards to this, but it creates a bit of inconsistency amongst our different Quarkus services when they're not reporting spans created the same way (and also making us have to parse non-log-lines).

Implementation ideas

Simply change the io.quarkus.jaeger.runtime.graal.Target_LoggingReporter

@Substitute
    @Override
    public void report(JaegerSpan span) {
        System.err.println("--- not logging: " + span);
    }

into:

@Substitute
    @Override
    public void report(JaegerSpan span) {
        logger.info("Span reported: {}", span);
    }

using org.jboss.logging.Logger

@christian-morin christian-morin added the kind/enhancement New feature or request label Jul 2, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 2, 2021

/cc @kenfinnigan

@kenfinnigan
Copy link
Member

We'd love for you to submit a PR with the proposed fix

@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jul 12, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.2.Final Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jaeger kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants