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

Support error and status.code searches #1093

Merged
merged 6 commits into from
Nov 2, 2021

Conversation

mdisibio
Copy link
Contributor

@mdisibio mdisibio commented Nov 1, 2021

What this PR does:
This PR adds support for searching on span status. Raw span status in OTLP is an integer, and this is recorded as the new tag status.code=<int> (this matches the way Grafana already displays this data). This can be searched directly, or via the following more user-friendly methods:

  1. status.code=unset|ok|error - The search pipeline will rewrite the text versions into a lookup for the corresponding integer. The tag name/value lookup apis will return these user-friendly texts and not the integers.
  2. error=true|false - A new virtual "error" tag can be searched that is rewritten into a lookup on status.code integer. Similarly, the tag name/value lookup apis will return this tag and the two values.

Which issue(s) this PR fixes:
Fixes part of #932

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

Left some comments/concerns, but overall this is really nice work. I like the concept of virtual tags to match the model Grafana uses when displaying the trace.

modules/distributor/search_data.go Outdated Show resolved Hide resolved
modules/querier/querier.go Outdated Show resolved Hide resolved
modules/querier/querier.go Outdated Show resolved Hide resolved
tempodb/search/pipeline.go Outdated Show resolved Hide resolved
mdisibio and others added 3 commits November 2, 2021 07:34
Co-authored-by: Koenraad Verheyden <koenraad.verheyden@posteo.net>
Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

Besides a possible simplification this looks good to me 👍

I like how this turned out, with the virtual tags and values we don't have to muck with the actual ingested data 😌

tempodb/search/pipeline.go Outdated Show resolved Hide resolved
@mdisibio mdisibio merged commit 79748ab into grafana:main Nov 2, 2021
@mdisibio mdisibio deleted the search-error-status-2 branch April 25, 2023 18:49
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.

None yet

2 participants