Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Allow to filter labelNames in series call #844

Merged

Conversation

simonswine
Copy link
Collaborator

@simonswine simonswine commented Jul 11, 2023

This will improve the response size of the application selector in the pyroscope app:

Can be used like this:

curl -vL  -d '{"label_names":["__profile_type__","__service_name__"]}' -X POST -H "content-type: application/json" http://localhost:4100/querier.v1.QuerierService/Series

{
  "labelsSet": [
    {
      "labels": [
        {
          "name": "__profile_type__",
          "value": "block:contentions:count:contentions:count"
        },
        {
          "name": "__service_name__",
          "value": "pyroscope"
        }
      ]
    },
[...]

@simonswine simonswine changed the title 20230711 filter label in series call Allow to filter labelNames in series call Jul 11, 2023
@cyriltovena
Copy link
Collaborator

Nice can you test this in ops ? See how long it takes, I think gzip is a must here since it will have a lot of profile_types repeated

@simonswine
Copy link
Collaborator Author

simonswine commented Jul 13, 2023

I have deployed this to ops, note I am on some not too fast wifi:

# not compressed and only __profile_types__ + __service_name__, trace id 949237ad6c92c78
100  366k    0  366k  100    55  98547     14  0:00:03  0:00:03 --:--:-- 98652
# gzip and only _profile_types__ + __service_name__, trace id 6dbd52a0fb25c754
100 14378    0 14323  100    55   4417     16  0:00:03  0:00:03 --:--:--  4440

# Gzip all labels, trace ID 1163c38219238509
100 3396k    0 3396k    0     2   303k      0 --:--:--  0:00:11 --:--:--  860k
# No gzip all labels, timed out after 30 sec+, trace ID 50a1f91b7db66dfa
100 58.9M    0 58.9M    0     2  1732k      0 --:--:--  0:00:34 --:--:-- 2899k

To get gzip with connect we need to just supply the accept-encoding: gzip

@simonswine simonswine marked this pull request as ready for review July 13, 2023 13:13
Copy link
Collaborator

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@cyriltovena cyriltovena merged commit 7aef408 into grafana:main Jul 13, 2023
17 checks passed
simonswine added a commit to simonswine/pyroscope that referenced this pull request Jul 18, 2023
* Add a parameter to filter label names returned

* Add drift in generation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants