Transformation of Meter to Influx line protocol has always 'unknown' metric_type
See original GitHub issueFork from issue #1296.
Transformation of Meter to Influx line protocol adds Tag metric_type with hardcoded value unknown. I think it should respect the registered type from Meter.getId().getType().
Stream.Builder<Field> fields = Stream.builder();
for (Measurement measurement : m.measure()) {
String fieldKey = measurement.getStatistic().toString()
.replaceAll("(.)(\\p{Upper})", "$1_$2").toLowerCase();
fields.add(new Field(fieldKey, measurement.getValue()));
}
return Stream.of(influxLineProtocol(m.getId(), "unknown", fields.build()));
I’d propose following:
- use Meter.getId().getType().toLowerCase() directly in influxLineProtocol(), drop the String metricType parameter
or in case this would cause an internal API change
- use Meter.getId().getType().toLowerCase() in writeMeter() method instead of unknown
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
InfluxDB line protocol tutorial - InfluxData Documentation
Tutorial for using InfluxDB line protocol. ... The InfluxDB line protocol is a text-based format for writing points to the database. Points must...
Read more >Blog | Prometheus
Prometheus was always about pushing boundaries when it comes to providing pragmatic, reliable, cheap, yet invaluable metric-based monitoring ...
Read more >Manpage collectd.conf(5)
This config file controls how the system statistics collection daemon collectd behaves. The most significant option is LoadPlugin, which controls which plugins ...
Read more >Common Application Properties - Spring
Name Description Default...
spring.cassandra.config Location of the configuration file to use.
spring.cassandra.controlconnection.timeout Timeout to use for control queries. 5s
spring.cassandra.keyspace‑name Keyspace name to use.
Read more >Configuration for the system statistics collection daemon collectd
This allows long lines to be split into multiple lines. ... Otherwise the conversion is performed using the internal value cache. Please note...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created #1446 to try to resolve this as @zeratul021 suggested.
Exactly our use-cases.
Meter type is an enum so if I’m forced to choose between other and anything more specific, I’ll lean towards the latter.
You are right. I was thinking of that too. Maybe we could add a new field metricType to Meter (DefaultMeter) that would be translated to metric_type with default value set to current unknown. That way it would be backwards compatible and properly fixed in 1.2.
Anyway, no rush to get that, just suggestion.