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

TraceQL: unequal span attribute filter filters traces that do not contain the span attribute #2618

Open
matthias-huber opened this issue Jul 6, 2023 · 2 comments
Labels
enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql

Comments

@matthias-huber
Copy link

Describe the bug
A typical usecase of TraceQL is to find all traces for an app that do not match specific span attributes, e.g. all traces that do not contain the http path /my/uri. Such a TraceQL could be

{resource.app = "my-app" && span.http.target != "/my/uri"}

This works if all traces of the app 'my-app' contain a span.attribute 'http.target'. Unfortunately, traces that do not contain that span.attribute are also filtered out and aren't searchable anymore without a workaround like

{resource.app = "my-app" && (span.http.target !="/my/uri" || span.existing.attribute != "")}

To Reproduce
Steps to reproduce the behavior:

  1. Start Tempo (SHA or version)
  2. Insert at least two traces, one with the span attribute and one without a span attribute.
  3. Use the above search a try to find the span without the attribute

Expected behavior
From my perspective, filtering should not filter traces that do not have the span.attribute.
Alternatively, TraceQL should provide a way to exclude traces from the result that match a condition. I am not aware of this functionality.

Environment:

  • Infrastructure: [e.g., Kubernetes, bare-metal, laptop]
  • Deployment tool: [e.g., helm, jsonnet]

Additional Context

@joe-elliott joe-elliott added enhancement New feature or request traceql labels Jul 6, 2023
@joe-elliott
Copy link
Member

Thanks for the report. These may be relevant:

Notting spansets
Attribute existence

From my perspective, filtering should not filter traces that do not have the span.attribute.

The general thought is that span.attribute != "foo" should include those spans that have span.attribute but don't equal foo as well as all spans that don't have that attribute.

We are currently doing a second round of TraceQL designs and this issue (along with the two linked ones) all seem to be pointing toward similar functionality. Thanks for filing the issue. We will take it into consideration while moving TraceQL forward.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

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 Sep 5, 2023
@joe-elliott joe-elliott added keepalive Label to exempt Issues / PRs from stale workflow and removed stale Used for stale issues / PRs labels Sep 5, 2023
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

2 participants