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

Update docs to include multiple tag support #4797

Merged
merged 3 commits into from
Oct 19, 2018
Merged

Update docs to include multiple tag support #4797

merged 3 commits into from
Oct 19, 2018

Conversation

adilyse
Copy link
Contributor

@adilyse adilyse commented Oct 15, 2018

This adds notes in the documentation about the support of multiple tags for service and health queries in the api, as well as for the additional telemetry created using this feature (#1781).

See the (now merged) PR for the related implementation.

@adilyse adilyse requested a review from a team October 15, 2018 21:24
Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Great job on getting these updated.

I'm really sorry having blundered through the original PR review to only now notice something I overlooked before for discussion 😭.

website/source/api/catalog.html.md Outdated Show resolved Hide resolved
website/source/docs/agent/telemetry.html.md Show resolved Hide resolved
@nugend
Copy link

nugend commented Oct 16, 2018

It wasn't mentioned in the original issue (#1781), but did negation make it in to this addition? If so, what's the syntax for negation.

@adilyse
Copy link
Contributor Author

adilyse commented Oct 16, 2018

@nugend This change specifically addressed the multiple tags so it didn't add support for negation. Could you please file a separate issue for it if you're needing it?

This addresses the potential proliferation of metrics if a query of
"?tag=foo&tag=bar" is treated differently than "?tag=bar&tag=foo".
Now, tags are always sorted before being recorded, making these two
emit the same metric.
@adilyse
Copy link
Contributor Author

adilyse commented Oct 16, 2018

@banks Ready for another review when you get a chance.

@adilyse
Copy link
Contributor Author

adilyse commented Oct 16, 2018

Note: After a little more investigation, it looks like the metrics endpoint (/v1/agent/metrics) will display incomplete information about metrics with multiple tags (see this issue), even though the metrics are outputted correctly and completely for external consumers.

I've added a note to this effect in the docs.

@nugend
Copy link

nugend commented Oct 17, 2018

@adilyse I've opened #4808 for tag negation. Hope it makes it on the schedule!

@banks
Copy link
Member

banks commented Oct 18, 2018

@adilyse commented on your go-metrics issue but I'm pretty sure that at least some of the popular stats sinks will not support multiple labels/tags with same key.

I suggest we either:

  1. concatenate the tags after sorting with commas and emit a single label like: tags="foo,bar,baz" this is a bit gross but can still be worked with in most metrics systems by matching on a regex or wildcard etc.
  2. Make the tag the name for the label instead and set the value to 1 e.g. foo=1, bar=1, baz=1. This works everywhere.

2 makes most sense to me now but curious if you can think of any reason that's a bad plan?

While I think this is fine now, I was interested to see this warning while trying to find in the Prometheus docs whether they support multiple lables with same key:

https://prometheus.io/docs/practices/naming/#labels

CAUTION: Remember that every unique combination of key-value label pairs represents a new time series, which can dramatically increase the amount of data stored. Do not use labels to store dimensions with high cardinality (many different label values), such as user IDs, email addresses, or other unbounded sets of values.

Emphasis mine. Technically tags is an unbounded value as is service name which is why they make me itchy but in practice these are shouldn't be used as unbounded in practice e.g. registering with random tags or unique tags for every new instance etc. So I still think it's OK - operators can always filter metrics that are not useful/too expensive for them.

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

As discussed in last comment!

@adilyse
Copy link
Contributor Author

adilyse commented Oct 19, 2018

After talking it through with @pearkes, I think we should leave it as-is for now. It provides additional value to the metrics systems that support multiple labels with the same key and is easily excluded for anyone who starts having trouble with it.

@banks banks merged commit db01a24 into master Oct 19, 2018
@banks banks deleted the docs/1781 branch October 19, 2018 15:52
mkeeler pushed a commit that referenced this pull request Oct 19, 2018
* Update docs to include multiple tag support

* Sort tags before using them in metrics

This addresses the potential proliferation of metrics if a query of
"?tag=foo&tag=bar" is treated differently than "?tag=bar&tag=foo".
Now, tags are always sorted before being recorded, making these two
emit the same metric.

* Add caveat about multiple tags returned by the metrics endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants