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

auto complete should not ignore meta tags if they are also metric tags#1649

Merged
replay merged 1 commit intomasterfrom
mix_meta_tags_and_normal_tags_in_autocomplete
Jan 29, 2020
Merged

auto complete should not ignore meta tags if they are also metric tags#1649
replay merged 1 commit intomasterfrom
mix_meta_tags_and_normal_tags_in_autocomplete

Conversation

@replay
Copy link
Copy Markdown
Contributor

@replay replay commented Jan 29, 2020

This PR is just undoing what was supposed to be a performance optimization.

Fixes: #1648

Tested with this scenario:

Created two metrics with fakemetrics:

  • some.id.of.a.metric.1;anothertag=somelongervalue
  • some.id.of.a.metric.2

Created meta record:

{
  "metaTags": [
    "anothertag=metavalue"
  ],
  "expressions": [
    "name=some.id.of.a.metric.2"
  ]
}

Using master, I call the autoComplete endpoint and get a result for the metric ending in .1 (metric tag) but not for the one ending with .2 (meta tag):

$ curl -s http://localhost:6070/tags/autoComplete/values -H 'Content-Type: json' -d '{"tag": "anothertag", "expr": ["name=some.id.of.a.metric.1"]}'  | jq
[
  "somelongervalue"
]
$ curl -s http://localhost:6070/tags/autoComplete/values -H 'Content-Type: json' -d '{"tag": "anothertag", "expr": ["name=some.id.of.a.metric.2"]}'  | jq
[]

Using this branch, I do the same two calls one more time, and now i get a result for both of them:

$ curl -s http://localhost:6070/tags/autoComplete/values -H 'Content-Type: json' -d '{"tag": "anothertag", "expr": ["name=some.id.of.a.metric.1"]}'  | jq
[
  "somelongervalue"
]
$ curl -s http://localhost:6070/tags/autoComplete/values -H 'Content-Type: json' -d '{"tag": "anothertag", "expr": ["name=some.id.of.a.metric.2"]}'  | jq
[
  "metavalue"
]

They can also be mixed in a single call:

$ curl -s http://localhost:6070/tags/autoComplete/values -H 'Content-Type: json' -d '{"tag": "anothertag", "expr": ["name=~some.id.of.a.metric.[12]"]}'  | jq
[
  "metavalue",
  "somelongervalue"
]

@replay replay merged commit 9e02687 into master Jan 29, 2020
@replay replay deleted the mix_meta_tags_and_normal_tags_in_autocomplete branch January 29, 2020 22:12
@Dieterbe
Copy link
Copy Markdown
Contributor

This PR is just undoing what was supposed to be a performance optimization.

is this reverting a specific PR or commit? which one? do we know the performance ramifications?

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.

Autocomplete ignores value of meta tags if there is a metric tag with the same name

3 participants