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

Add a limit parameter to search tags and tag values endpoints #4288

Open
joe-elliott opened this issue Nov 5, 2024 · 5 comments · May be fixed by #4320
Open

Add a limit parameter to search tags and tag values endpoints #4288

joe-elliott opened this issue Nov 5, 2024 · 5 comments · May be fixed by #4320
Assignees
Labels
component/query-frontend enhancement New feature or request frontend-hardening-aw-snap A label for the aw snap tiger team

Comments

@joe-elliott
Copy link
Member

There are currently a few server side options that can be set to limit the impact of tag and tag value queries:

max_bytes_per_tag_values_query
max_blocks_per_tag_values_query

However, it's likely a user of Tempo may want to purposefully limit the number of tags returned on large queries. Let's add a query parameter allowing the caller of Tempo to indicate the maximum number of results they would like to see.

/api/v2/searc/tags?limit=<int>
/api/v2/search/tag/<tag>/values?limit=<int>

@javiermolinar javiermolinar added the good first issue Good for newcomers label Nov 5, 2024
@KekmaTime
Copy link

@joe-elliott i would like to work on this issue if you can assign me this

@joe-elliott
Copy link
Member Author

I'm not quite sure this is a good first issue. It would require small/detailed changes in the query frontend, proto, querier and ingester code in order to do the basic task of limiting tags effectively.

ideally it would also propagate the limitation back from the ingester/querier to the frontend so the frontend could be warned that results were cut off.

i love that you jumped in when you saw something marked "good first issue", but understand if this perhaps a bit more then you were ready to try. wdyt?

@javiermolinar
Copy link
Contributor

javiermolinar commented Nov 12, 2024

@joe, @adrapereira regarding limiting the Tags endpoint. This endpoint returns the tags for the different scopes: resource, event, links etc.

If we just count the number of tags we could end with only one scope populated ie:

http://localhost:3200/api/v2/search/tags?limit=10
{
  "scopes": [
    {
      "name": "resource",
      "tags": [
        "k6",
        "service.name"
      ]
    },
    {
      "name": "intrinsic",
      "tags": [
        "duration",
        "event:name",
        "event:timeSinceStart",
        "instrumentation:name",
        "instrumentation:version",
        "kind",
        "name",
        "rootName",
        "rootServiceName"
      ]
    }
  ],
  "metrics": {
    "inspectedBytes": "165714"
  }
}

Also, the order is not guaranteed, so we could get intrinsic in one request and resource in a subsequent one.

A possibility would be to use the limit per scope. So if we set the limit to 50 that means up to 50 tags for intrinsics, resource, links etc. We could also divide the limit between the different scopes but we can end in the same problem as the example.

What do you think?

@adrapereira
Copy link

Do the intrinsics matter for this limit? There will never be a way for the intrinsics list to be large enough for it to matter in my opinion.

I'm not against the limit being per scope, I feel like it's the less confusing option.

@joe-elliott
Copy link
Member Author

Yeah, intrinsic don't really matter, but i'm also fine with the "per scope" interpretation for the tags endpoint.

@javiermolinar javiermolinar linked a pull request Nov 13, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/query-frontend enhancement New feature or request frontend-hardening-aw-snap A label for the aw snap tiger team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants