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

Allow searching by event attribute in TraceQL #2313

Open
CinchBlue opened this issue Apr 7, 2023 · 8 comments
Open

Allow searching by event attribute in TraceQL #2313

CinchBlue opened this issue Apr 7, 2023 · 8 comments
Labels
enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql

Comments

@CinchBlue
Copy link

CinchBlue commented Apr 7, 2023

Is your feature request related to a problem? Please describe.
With TraceQL, I currently cannot find a way to filter for traces by event attributes (it seems I can only filter by span or resource attributes).

Describe the solution you'd like
Within TraceQL Concepts, scoped attribute fields are present. It may be useful to also add another "scope" such as event so that we can extend TraceQL to also filter on event attribute fields. This would allow queries like this:

{
  .service.name="foo-service" && 
  .deployment.environment="production"
}
&& {
  span.query=~".*specific query type.*"
}
&& {
  event.message=~".*cache miss.*"
}

Describe alternatives you've considered
Could possibly derive the mappings/groupings from logs + regex + manual aggregation, but that sort of defeats the purpose of having a trace search/aggregation language built into Tempo already.

Additional context
This is relevant to the case where you want to filter traces by specific events, such as a cache miss message or log:

The image contains a event with an attribute pairing of message: cache miss

@CinchBlue CinchBlue changed the title Allow event searching by attribute in TraceQL Allow searching by event attribute in TraceQL Apr 7, 2023
@joe-elliott joe-elliott added enhancement New feature or request traceql labels Apr 10, 2023
@joe-elliott
Copy link
Member

Agree this would be a nice feature. Note that we currently encode the value using proto and store it here:

https://github.com/grafana/tempo/blob/main/tempodb/encoding/vparquet2/schema.go#L98

To be able to query this efficiently we would need to encode Event attributes the same way we encode span attributes which may have an adverse effect on file size.

@midN
Copy link

midN commented May 17, 2023

👍 On that, this will be useful on very many occasions.

For example, we've enabled Mimir traces and were interested in finding particular queries executed to see how they were executed, through which shards requests went through and how many queries the search was split into.
Finding a specific query executed was only doable with http.url parameter, which has encoded query values.
At the same time Events for Mimir spans had a full query listed in it's original format.
Being able to search by Events in TraceQL would have allowed to find these queries in much more granular way

@Bruno-DaSilva
Copy link

Another use case: we use opentelemetry autoinstrumentation in our apps and events are what contain stacktraces - we'd like to be able to search those if possible.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity in the past 60 days.
The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity.
Please apply keepalive label to exempt this Issue.

@github-actions github-actions bot added the stale Used for stale issues / PRs label Jul 17, 2023
@joe-elliott joe-elliott added keepalive Label to exempt Issues / PRs from stale workflow and removed stale Used for stale issues / PRs labels Jul 17, 2023
@nrakltx
Copy link
Contributor

nrakltx commented Sep 3, 2023

Is there any workaround for @Bruno-DaSilva's use case?
I want to be able to see stacktraces from my Python application in Grafana (connected to a Tempo datasource), and the Python SDK records exceptions and adds them as events, but there is no way of seeing those events on Tempo.
The only option I can think of is to copy all the span events and make them a list of attributes, but this is quite ad-hoc and probably not best practice.

@joe-elliott
Copy link
Member

Currently there is no way to query events, but this is being worked on. We are defining it in the language and one of the goals of vParquet4 will be to encode events directly in the Parquet for increased efficiency.

Expect to see a PR in the coming weeks that defines the TraceQL extensions similar to our original core concepts doc. We've already started conversations on two extensions to the language we have defined:

#2810
#2805

@JorTurFer
Copy link

JorTurFer commented Jun 5, 2024

Is there any update here? We'd love to have this feature 😄

@joe-elliott
Copy link
Member

A wip PR is up now: #3748

there are some technical hurdles to overcome, but it is in development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql
Projects
None yet
Development

No branches or pull requests

6 participants