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

feat: make tags work in the ui #620

Merged
merged 5 commits into from
Apr 14, 2023
Merged

feat: make tags work in the ui #620

merged 5 commits into from
Apr 14, 2023

Conversation

eh-am
Copy link
Collaborator

@eh-am eh-am commented Apr 11, 2023

Screen.Recording.2023-04-11.at.10.46.57.mov

Adds supports to the labels/tags selector in the UI. It uses the querier.v1.QuerierService/Series API as suggested by @simonswine

  • It's all done client side. The server returns way more data than needed, but decided to take the simple approach for now and fix in the frontend.
  • It only shows tags/labels that are valid for that profileTypeId. For example, it doesn't show dynamic tags for memory, only CPU.

@Rperry2174 Rperry2174 requested a review from simonswine April 11, 2023 17:18
Copy link
Collaborator

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

I think this already goes in a good way.

I think we should at least support matchers (as they are supported by our index as present (as opposed to the exact timestamps supplied by from/to)

Here is a curl example of this:

curl -sL -d '{"matchers": ["{__profile_type__=\"goroutine:goroutine:count:goroutine:count\"}"]}' -X POST -H "content-type: application/json" https://play-phlare.grafana.org/querier.v1.QuerierService/Series
{"labelsSet":[{"labels":[{"name":"__name__", "value":"goroutine"}, {"name":"__period_type__", "value":"goroutine"}, {"name":"__period_unit__", "value":"count"}, {"name":"__profile_type__", "value":"goroutine:goroutine:count:goroutine:count"}, {"name":"__type__", "value":"goroutine"}, {"name":"__unit__", "value":"count"}, {"name":"app_kubernetes_io_component", "value":"all"}, {"name":"app_kubernetes_io_instance", "value":"phlare"}, {"name":"app_kubernetes_io_name", "value":"phlare"}, {"name":"container", "value":"phlare"}, {"name":"controller_revision_hash", "value":"phlare-58775689d6"}, {"name":"instance", "value":"10.145.176.117:4100"}, {"name":"job", "value":"kubernetes-pods-name"}, {"name":"name", "value":"phlare"}, {"name":"namespace", "value":"profiles-prod-play"}, {"name":"pod", "value":"phlare-0"}, {"name":"statefulset_kubernetes_io_pod_name", "value":"phlare-0"}]}]

@eh-am eh-am marked this pull request as ready for review April 13, 2023 14:15
@eh-am
Copy link
Collaborator Author

eh-am commented Apr 13, 2023

Actually still have to handle the default case, when the backend doesn't return anything.

Copy link
Collaborator

@simonswine simonswine left a comment

Choose a reason for hiding this comment

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

LGTM.

This works well for the single binary mode. But when I try the micro-services mode, it misses the pyroscope endpoints. (I will look into a separate PR).

@eh-am eh-am merged commit 8df8adb into main Apr 14, 2023
@eh-am eh-am deleted the feat/ui-labels branch April 14, 2023 10:14
simonswine pushed a commit to simonswine/pyroscope that referenced this pull request Jun 30, 2023
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.

2 participants