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

return full metric names with tags #755

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

replay
Copy link
Contributor

@replay replay commented Nov 2, 2017

When calling /metrics/tags/findSeries the returned results should be the full metric names including tags.

mst@mst-nb1:~$ curl -s 'http://localhost:6060/metrics/tags/findSeries' -H 'X-Org-Id: 1'  -X POST -H 'Content-Type: application/json' -d '{"expr":["name=~.+metric.[0-9]$"]}' | jq '.'
[
  "some.id.of.a.metric.4;metric=some.id.of.a.metric;name=some.id.of.a.metric.4;some=tag",
  "some.id.of.a.metric.5;metric=some.id.of.a.metric;name=some.id.of.a.metric.5;some=tag",
  "some.id.of.a.metric.3;metric=some.id.of.a.metric;name=some.id.of.a.metric.3;some=tag",
  "some.id.of.a.metric.9;metric=some.id.of.a.metric;name=some.id.of.a.metric.9;some=tag",
  "some.id.of.a.metric.8;metric=some.id.of.a.metric;name=some.id.of.a.metric.8;some=tag",
  "some.id.of.a.metric.1;metric=some.id.of.a.metric;name=some.id.of.a.metric.1;some=tag",
  "some.id.of.a.metric.7;metric=some.id.of.a.metric;name=some.id.of.a.metric.7;some=tag",
  "some.id.of.a.metric.6;metric=some.id.of.a.metric;name=some.id.of.a.metric.6;some=tag",
  "some.id.of.a.metric.2;metric=some.id.of.a.metric;name=some.id.of.a.metric.2;some=tag"
]

for _, tag := range def.Tags {
pos += copy(b[pos:], ";")
pos += copy(b[pos:], tag)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks good for perf 👍

Copy link
Contributor

@Dieterbe Dieterbe left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@DanCech DanCech left a comment

Choose a reason for hiding this comment

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

Looks good, just fix the gofmt error

@replay replay force-pushed the find_series_return_full_metric_name branch from 4c19d02 to f1116e7 Compare November 2, 2017 18:44
@replay
Copy link
Contributor Author

replay commented Nov 2, 2017

@DanCech fixed now

@Dieterbe Dieterbe merged commit 414754d into master Nov 2, 2017
@Dieterbe Dieterbe deleted the find_series_return_full_metric_name branch September 18, 2018 08:59
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.

3 participants