question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transformation of Meter to Influx line protocol has always 'unknown' metric_type

See original GitHub issue

Fork 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:

  1. use Meter.getId().getType().toLowerCase() directly in influxLineProtocol(), drop the String metricType parameter

or in case this would cause an internal API change

  1. use Meter.getId().getType().toLowerCase() in writeMeter() method instead of unknown

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
izeyecommented, Jun 3, 2019

I created #1446 to try to resolve this as @zeratul021 suggested.

0reactions
zeratul021commented, Apr 1, 2019

I suppose there are cases for those types with semantics that differ from Micrometer’s implementation. So this change seems reasonable to me.

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.

Though changing the value of the metric_type tag in a point release for custom meters would be a breaking change for people relying on the current value.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found