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

Remove returning error message when ObserverContext is null while adding tags to Metrics #89

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

NipunaMadhushan
Copy link
Contributor

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
error: client method invocation failed: Can not add tag {http.method:GET}

We do not need to return error when the Observer Context is null (i.e. Observer Context is null only in the initializing phase). Other than that, observability features should not affect the application as well (Should only return warning logs or error logs).

With this PR, null value will be returned instead of returning an error when Observer Context is null.

###Fixes ballerina-platform/ballerina-lang#41966

Copy link
Contributor

@warunalakshitha warunalakshitha left a comment

Choose a reason for hiding this comment

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

LGTM

@NipunaMadhushan NipunaMadhushan merged commit 3cd5259 into ballerina-platform:main Jan 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Project fails when there are global variables declared with client invokes
2 participants