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

Implement HTTP API for getting all label names #2038

Closed
juliusv opened this Issue Sep 28, 2016 · 8 comments

Comments

Projects
None yet
9 participants
@juliusv
Copy link
Member

juliusv commented Sep 28, 2016

Would be relevant for grafana/grafana#6038 (cc @bergquist).

Endpoint would be:

GET /api/v1/labels

Output would be:

{
   "status" : "success",
   "data" : [
      "__name__",
      "job",
      "instance",
      "method",
      "status",
      "path"
   ]
}

This isn't a trivial change, as it requires plumbing all the way down to the storage layer and the LevelDB index accessor functions.

@opsnull

This comment has been minimized.

Copy link

opsnull commented May 12, 2017

any updating ?

@brancz

This comment has been minimized.

Copy link
Member

brancz commented May 12, 2017

I don't think we'll tackle this before 2.0 as LevelDB is going away completely for that and this feature would have to be rewritten entirely. @fabxc what is your stance on getting something like this into the 2.0 dev branch? However I wouldn't expect this to be too difficult with the 2.0 storage given that we are already keeping indices of labels and their values, right @fabxc ?

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented May 12, 2017

Yea, that should be reasonably easy to do. I also want to investigate composite indices against metric names then, i.e. "what are all possible values of label instance for metric requests_total".

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Jan 25, 2018

@fabxc @gouthamve This just came up again in a discussion with @davkal (it could be useful for the UIs he's building). Do you have any more insight into how to do this efficiently on top of the new storage? To do it properly with minimal overhead, it'd probably need a new TSDB interface function?

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Jan 25, 2018

So the tsdb.Querier already exposes it: https://github.com/prometheus/tsdb/blob/master/querier.go#L34-L35

We need to add it to the Storage interface I guess.

@shubheksha

This comment has been minimized.

Copy link
Contributor

shubheksha commented Feb 8, 2018

@gouthamve, that returns all the values, not names. A new function will be needed. See prometheus/tsdb#279

@codesome

This comment has been minimized.

Copy link
Member

codesome commented Nov 7, 2018

With prometheus/tsdb#369 being merged, I will be adding this API soon!

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Nov 9, 2018

the work on tsdb side is done so removed the local storage label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.