-
Notifications
You must be signed in to change notification settings - Fork 458
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
Add some guidelines about the use of metrics metadata and dimensions #5270
Conversation
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
|
🌐 Coverage report
|
I added @agithomas as reviewer as he is thinking about this topic a lot at the moment. |
|
||
It is important to choose wisely the set of fields, they should be the minimal set | ||
of dimensions required to properly identify any time serie included in the data stream. | ||
Too few dimensions can mix data of multiple time series into a single one, too many can |
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.
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.
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.
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.
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 the namespace
as labels. If you add the namespace
label later, you are creating new time series, disconnected from the previous ones, even for pods where their name
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.
LGTM for the first version. We can start building on this to add more content/reference for TSDB going forward. |
Relates to #4124.