-
Notifications
You must be signed in to change notification settings - Fork 462
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
Add some guidelines about the use of metrics metadata and dimensions #5270
Merged
jsoriano
merged 1 commit into
elastic:main
from
jsoriano:notes-about-metrics-dimensions
Feb 23, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we provide specific guideline on lower bound and higher bound on dimensions count? Otherwise, this question will come up in the future, in multiple forums.
I am also trying to understand, why elastic TSDB enforces a lower bound on dimensions (too few dimensions is an issue) and where-as in prometheus TSDB metrics can be ingested without labels(dimension) and does not break anything there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite dependant of the context. And even for the same object it may vary depending on the available data. For example if you are monitoring containers in Kubernetes pods, and you have the container ID, this may be the only dimension needed, but if you don't have the container ID, you may need to use at least the container name, the pod name and the pod namespace as dimensions.
There are things like HTTP requests where we may want to store lots of dimensions, such as the method, source IP, url path, query parameters, important headers, backend handling the request and so on. For these cases we have a higher bound of 16 dimensions, that is checked by Elasticsearch itself. But this limit can be raised per data stream if needed, using the
index.mapping.dimension_fields.limit
option.It is actually similar with Prometheus, it is not that things "break", but there can be misbehaviours.
For example if you ingest Kubernetes pod metrics only with the label
name
, and you have pods with the same name in different namespaces, you are going to have the same kind of problems also in Prometheus (only one metric is stored for the same timestamp, and mixed metrics of different pods in the same time serie).Thus you need to use the
name
and thenamespace
as labels. If you add thenamespace
label later, you are creating new time series, disconnected from the previous ones, even for pods where theirname
was unique.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsoriano for the clarifications. I am good for the document to the merged.
There is a separate discussion happening for dimensions in separate threads, to clarify/close some of these aspects.