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

[Bug]: java.lang.NoSuchMethodError with tracing enabled #42546

Open
MaryamZi opened this issue Apr 15, 2024 · 2 comments
Open

[Bug]: java.lang.NoSuchMethodError with tracing enabled #42546

MaryamZi opened this issue Apr 15, 2024 · 2 comments
Labels
Team/Observability Observability in general, Metrics, Tracing & Logging Type/Bug

Comments

@MaryamZi
Copy link
Member

MaryamZi commented Apr 15, 2024

Description

$title.

ballerina: started Prometheus HTTP listener 0.0.0.0:9797
[2024-04-15 18:56:38,274] SEVERE {b7a.log.crash} - 'io.opentelemetry.api.metrics.LongCounterBuilder io.opentelemetry.api.metrics.Meter.longCounterBuilder(java.lang.String)' 
java.lang.NoSuchMethodError: 'io.opentelemetry.api.metrics.LongCounterBuilder io.opentelemetry.api.metrics.Meter.longCounterBuilder(java.lang.String)'
        at io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter.<init>(OtlpGrpcSpanExporter.java:64)
        at io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporterBuilder.build(OtlpGrpcSpanExporterBuilder.java:188)
        at io.ballerina.observe.trace.jaeger.JaegerTracerProvider.initializeConfigurations(JaegerTracerProvider.java:73)
        at ballerinax.jaeger.0.tracer_provider.externInitializeConfigurations(tracer_provider.bal:47)
        at ballerinax.jaeger.0.tracer_provider.init(tracer_provider.bal:42)
        at ballerinax.jaeger.0.$_init.$gen$&0046&0060init&0062(jaeger:1)
        at maryam.obs_proj.0.$_init.$moduleInit(obs_proj)
        at maryam.obs_proj.0.$_init.$moduleExecute(obs_proj)
        at maryam.obs_proj.0.$_init.$lambda$$moduleExecute$(obs_proj)
        at io.ballerina.runtime.internal.scheduling.SchedulerItem.execute(SchedulerItem.java:54)
        at io.ballerina.runtime.internal.scheduling.Scheduler.run(Scheduler.java:320)
        at io.ballerina.runtime.internal.scheduling.Scheduler.runSafely(Scheduler.java:287)
        at java.base/java.lang.Thread.run(Thread.java:833)

Steps to Reproduce

import ballerina/http;
import ballerina/log;
import ballerinax/prometheus as _;
import ballerinax/jaeger as _;

service /hello on new http:Listener(9090) {
    
    resource function get sayHello(http:Caller caller, http:Request req) returns error? {
        log:printInfo("This is a test Info log");
        log:printError("This is a test Error log");
        http:Response res = new;
        res.setPayload("Hello, World!");
        check caller->respond(res);
    }
    
}
[ballerina.observe]
metricsEnabled=true
metricsReporter="prometheus"
tracingEnabled=true
tracingProvider="jaeger"

[ballerinax.prometheus]
port=9797
host="0.0.0.0"

Affected Version(s)

2201.9.0 test pack

@MaryamZi MaryamZi added Type/Bug Team/Observability Observability in general, Metrics, Tracing & Logging labels Apr 15, 2024
@NipunaMadhushan
Copy link
Contributor

This happens when tracing is enabled and it occurs due to the update of opentelemetry version in lang.

We have done the relevant changes in the jaeger module as well with the PR [1].

  1. Refractor module along with opentelemetry version update module-ballerinax-jaeger#164

PR has not been merged since we need to release the distribution first.

@NipunaMadhushan
Copy link
Contributor

Tested locally with the changes in the above mentioned PR and works fine as expected.

@MaryamZi MaryamZi changed the title [Bug]: java.lang.NoSuchMethodError with metrics enabled [Bug]: java.lang.NoSuchMethodError with tracing enabled Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team/Observability Observability in general, Metrics, Tracing & Logging Type/Bug
Projects
None yet
Development

No branches or pull requests

2 participants