-
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
Enhance Histogram feature implementation of Prometheus Server Integration #5042
Comments
For the histograms in Elasticsearch that you showed above as sample outputs, are these stored with histogram field type? If yes, is this done by a dynamic template? In the case of APM Agents AFAIK there is a dynamic template name that gets assigned in the ingest pipeline: https://github.com/elastic/apm-server/blob/main/apmpackage/apm/data_stream/app_metrics/elasticsearch/ingest_pipeline/default.yml#L16-L35 Can you get the exact mapping of the index that is created for the fields you listed above. This will also help investigate why the fields do not show up in the query. |
Indeed they are stored as Also to add some more details after some more testing:
All the histograms do not appear on the filter search box. So I can not create a filter with histogram type fields maybe? |
What does
@gizas Can you share the query / filter you would want to run on this histogram. You are correct that you can't filter on a histogram value but only run aggregations. |
Unmapped= Fields that are not explicitly matched to a field data type There is no reference for And as for the filter I was trying the simple exists filter, like: |
Ok, I assume all these fields fall back to keyword as it is set as default mapping?
Is this just for testing or is it what you will want to use in some visualisations? Exists query only works when the field is indexed which is not the case for histogram and likely not the case for most metrics in the future. The assumption we are following is that most metrics are not used for filtering but aggregations. Does this apply here too? |
_bucket fields are coming as And yes the filter was just for testing. I guess for now indeed does not seem a valid user scenario. |
I was performing the tests with managed agent and was switching on/off the Use_types and Rate_Counters. So that is why the fields come as Unmapped until we refresh whole browser. Seems like Kibana has some kind of cache or does some mapping in the background and until you refresh you dont take the updates. So bottom line And Documentation for not indexing histograms see here |
For these mappings, lets make sure we always refer to the Elasticsearch types / mappings and not kibana data views as the ES ones are the ones that count. Glad to see the follow up details on the actual mapping in Elasticsearch. @gizas Let me know if there anything further you need on my end. |
3 points above are covered by elastic/beats#36647
this need investigation |
Context
Histograms are a one of the supported types of metrics of Prometheus toolkit. In general Histograms provide pre-aggregated numerical values in the form of groups.
In our Prometheus Integration we currently provide support of histogram type by enabling
Use types
option. By enabling this option, we retrieve prometheus metrics categorised as histograms and index those inside Elasticsearch. We have identified that support of histograms through Elasticsearch needs specific pre-processing on index time in our integration package. Additionally, relevant efforts (1165, 26903) revealed possible enhancements that can be added to our code.Diagnosis
Users have reported differences between the histograms scraped from Prometheus comparing to the ones we save inside Elasticsearch . This revealed the extra calculation we during ingestion time and also the need to document and explain the procedure to our users.
Prometheus Buckets scraped:
Elasticsearch Histograms we ingest (retrieved from Kibana Discovery):
Questions that we need to answer:
le
Bucket values are different than the ones we see in Elastic?value
in Elasticsearch of the+Inf
bucket ?(Code Ref) In our example: 120 + (120-60) = 180, so it matches with 180 Value.
Additionally for http_request_duration_seconds, Prometheus offers
prometheus_http_request_duration_seconds_count:1
andhttp_request_duration_seconds_sum:1
.Count and Sum values are not returned in from our code, so not present in Elasticsearch. Is there any valid scenario where those might needed?
Also prometheus_http_request_duration_seconds_histogram field is not available to search and provide filters in Kibana Discovery
Comparing to other fields:
Action
This story summarizes all the actions we have categorised that are needed in order to enhance the Prometheus Histogram support in our integration:
Code Enhancements:
sum
andcount
values additonally to the ones we provide nowKibana Support:
Check available Use Cases of histograms here
Documentation Enhancement:
Deliverables
Relevant Links
Useful External links
The text was updated successfully, but these errors were encountered: