Skip to content

Support error and status.code searches#1093

Merged
mdisibio merged 6 commits intografana:mainfrom
mdisibio:search-error-status-2
Nov 2, 2021
Merged

Support error and status.code searches#1093
mdisibio merged 6 commits intografana:mainfrom
mdisibio:search-error-status-2

Conversation

@mdisibio
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@yvrhdn yvrhdn 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.

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

@yvrhdn yvrhdn 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 😌

Comment thread tempodb/search/pipeline.go Outdated
@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.

2 participants