Micrometer logs error message when partial error happens due to Infinity value using Elasticsearch
See original GitHub issueMicrometer core and micrometer-elastic version: 1.1.3
Springboot version: 2.1.3.RELEASE
Hi, Using micrometer getting metrics from springboot application using micrometer-registry-elastic
Micrometer keeps logging error messages:
ERROR [market-fetcher,,,] 8106 --- [trics-publisher] i.m.elastic.ElasticMeterRegistry : failed to send metrics to elastic:
When checking elastic index it’s working, index get’s updated with new values but I noticed one of the entries in there reports an error:
{"index":{"_index":"market-fetcher-metrics-2019-04","_type":"doc","_id":"XyEp_WkB2oH6K2ScUlT5","status":400,"error":{"type":"mapper_parsing_exception","reason":"failed to parse [value]","caused_by":{"type":"illegal_argument_exception","reason":"[float] supports only finite values, but got [Infinity]"}}}}
which is probably what’s causing the error log entry being generated. I guess it should instead be able to wrap / handle Infinity? Also not sure where the error is exactly from as we don’t explicitly wrap any of the metrics in primitive float, still investigating that.
Find below a full entry of the log error message and pls let me know if it needs further details.
‘2019-04-08 15:35:37.761 ERROR [market-fetcher,] 8106 — [trics-publisher] i.m.elastic.ElasticMeterRegistry : failed to send metrics to elastic: {“took”:24,“errors”:true,“items”:[{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“CCEp_WkB2oH6K2ScUlT5”,“_version”:1,“result”:“created”,“_shards”:{“total”:2,“successful”:1,“failed”:0},“_seq_no”:322,“_primary_term”:1,“status”:201}},{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“CSEp_WkB2oH6K2ScUlT5”,“_version”:1,“result”:“created”,“_shards”:{“total”:2,“successful”:1,“failed”:0},“_seq_no”:328,“_primary_term”:1,“status”:201}}, … ,{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“XyEp_WkB2oH6K2ScUlT5”,“status”:400,“error”:{“type”:“mapper_parsing_exception”,“reason”:“failed to parse [value]”,“caused_by”:{“type”:“illegal_argument_exception”,“reason”:“[float] supports only finite values, but got [Infinity]”}}}},{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“YCEp_WkB2oH6K2ScUlT5”,“_version”:1,“result”:“created”,“_shards”:{“total”:2,“successful”:1,“failed”:0},“_seq_no”:345,“_primary_term”:1,“status”:201}},{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“YSEp_WkB2oH6K2ScUlT5”,“_version”:1,“result”:“created”,“_shards”:{“total”:2,“successful”:1,“failed”:0},“_seq_no”:341,“_primary_term”:1,“status”:201}}, … ,{“index”:{“_index”:“market-fetcher-metrics-2019-04”,“_type”:“doc”,“_id”:“EiEp_WkB2oH6K2ScUlX6”,“_version”:1,“result”:“created”,“_shards”:{“total”:2,“successful”:1,“failed”:0},“_seq_no”:383,“_primary_term”:1,“status”:201}}]}’
Issue Analytics
- State:
- Created 4 years ago
- Comments:24 (13 by maintainers)
Top GitHub Comments
As @izeye’s sample shows, you need to add to your build configuration the repository that we publish snapshots to (
https://repo.spring.io/libs-snapshot
) and then use the snapshot version1.1.5-SNAPSHOT
. https://github.com/micrometer-metrics/micrometer#snapshot-buildsThis looks exactly like the original error I posted indeed.