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

Add trace ID to local logs in Karaf so we can relate local transactions with those on the cloud side #111

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

deejgregor
Copy link
Contributor

@deejgregor deejgregor commented Feb 13, 2023

This fixes two bugs and makes a supportability improvement:

It adds tracing for a few more calls:

And lastly, it also passes the gRPC status code upstream (the span status code only has three allowable values, so it cannot be used for this):

…atus.getNumber

If there was a null TraceStatus, UNRECOGNIZED was returned in
convertToTraceStatus, but UNRECOGNIZED couldn't be converted later
to an span status.

OpenTelemetry only supports three kinds of span statuses:
- Unset
- Ok
- Error
-- https://opentelemetry.io/docs/concepts/signals/traces/#span-status

Simplified the status handling to treat everything as Ok or Error
based on the gRPC status code.
It was confusing to see the "received cloud log with" log message locally
but not see anything upstream. Until I looked at the code. It was easy to
not special case this.

Note that I tweaked the loop that works through the queue to do/while to
avoid a loop where the queue always have something in it from the SendTraces
call that it just did.
This is helpful for diagnosing server-side issues in TSaaS when
bringing up the cloud plugin.

There's still more to do for other non-tsaas-gateway calls, both within
the cloud plugin and on backend services in the cloud, but I think
this gets us pretty good coverage for calls into the tsaas-gateway.
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 3 Code Smells

72.5% 72.5% Coverage
0.0% 0.0% Duplication

Without this, I got:

    failed uploading test results: File: home/circleci/junit/failsafe-summary.xml had the following problems:
      * invalid top level element: failsafe-summary

-- source: https://app.circleci.com/pipelines/github/OpenNMS/opennms-cloud-plugin/883/workflows/d6d81040-80ec-4342-8fda-1e1fd9a37a1c/jobs/2104?invite=true#step-106-31

Snagged this line from Horizon classic: https://github.com/OpenNMS/opennms/blob/develop/.circleci/main/commands/executions/run-integration-tests.yml#L38
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.

1 participant