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

Extend the tracing capabilities to set a span's status #588

Closed
AlexanderWert opened this issue Mar 3, 2020 · 1 comment · Fixed by #614
Closed

Extend the tracing capabilities to set a span's status #588

AlexanderWert opened this issue Mar 3, 2020 · 1 comment · Fixed by #614
Assignees
Labels
area/agent enhancement New feature or request

Comments

@AlexanderWert
Copy link
Contributor

AlexanderWert commented Mar 3, 2020

Currently, all collected spans provides a status attribute which is set to Status.OK.
This status attribute will be used by certain tracing backend systems for e.g. visualization or grouping of collected spans.

In this ticket, the ability should be implemented to assign a custom status to a span.

Using OpenCensus, a span's status is set as following:

span.setStatus(Status.NOT_FOUND.withDescription("Cache miss"))

It should be able to set the status using a constant value or dynamically via the data context.

@mariusoe mariusoe changed the title Allow to set the span status Extend the tracing capabilities to set a span's status Mar 3, 2020
@mariusoe mariusoe added area/agent enhancement New feature or request labels Mar 3, 2020
@JonasKunz
Copy link
Member

I would suggest that we start with only error / success status, to keep it simple for now.
This is sufficient to visualize the errornous spans in the tracing backends, details liek the http status or error messages can already be added as attributes to spans.

I would suggest the following configuration approach:

my_rule:
  tracing:
    error-status: my_data_key

When the instrumented method finishes, the given data key is read and "interpreted" as error status. This means, if the value is neith null nor false, the span is marked with the OpenCensus UNKOWN status code, which seems to be the general purpose one.

Why null or false? I have the following two use-cases in mind:

first_rule:
  tracing:
    error-status: _thrown
second_rule:
  tracing:
    error-status: is_error

The first rule most-likely is the 99% case: make the span as an error, if any exception was thrown.
The second rule is for special stuff, such as http: here we can derive the is_error booelan for example from the http_status code and therefore mark the span accordingly.

@JonasKunz JonasKunz self-assigned this Mar 6, 2020
JonasKunz added a commit to JonasKunz/inspectit-ocelot that referenced this issue Mar 10, 2020
@mariusoe mariusoe linked a pull request Mar 19, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants