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]: Project fails when there are global variables declared with client invokes #41966

Assignees
Labels
Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug

Comments

@NipunaMadhushan
Copy link
Contributor

Description

When observability enabled and the project contains global variables declared (or init() functions) with client invokes, the following error occurs in the ballerina runtime.

ballerina: started publishing traces to Jaeger on localhost:55680
ballerina: started Prometheus HTTP listener 0.0.0.0:9797
https://api.asgardeo.io/t/bifrost/oauth2/token/.well-known/openid-configurationerror: client method invocation failed: Span already finished. Can not add tag {http.url:/}

The reason for error is that the spans are created only after declaring variables. Spans won't be created for init() functions as well.

Steps to Reproduce

Use the following sample.

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

http:Client clientEP = check new("www.google.com");
http:Response res = check getResponse();  

function getResponse() returns http:Response|error {
    return check clientEP->/;
}

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Runtime

Related issue(s) (optional)

https://github.com/wso2-enterprise/internal-support-ballerina/issues/556

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Team/jBallerina All the issues related to BIR, JVM backend code generation and runtime Type/Bug
Projects
None yet
3 participants