goprometheusvictoriametrics

Does VictoriaMetrics have some way to store string value instead float64?


I'm using basic victoria metrics via docker image https://hub.docker.com/r/victoriametrics/victoria-metrics/ and import the float value via prometheus:

curl -d 'foo{bar="baz"} 123' -X POST 'http://localhost:8428/api/v1/import/prometheus'

I saw from the victoriaMetrics code that after parsing the value is always float64, but maybe we have some way to store the errors that occurred for example?

Additional question: After reading this one https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md#text-based-formatI didn't understand which prometheus type is stored in victoriaMetrics when we're using /api/v1/import/prometheus? Untyped?


Solution

  • but maybe we have some way to store the errors that occurred for example?

    Unfortunately, no. You can put string values into labels, but metric value will be only float64.

    which prometheus type is stored in victoriaMetrics when we're using /api/v1/import/prometheus? Untyped?

    While the exposition format for metric type exists, neither Prometheus nor VictoriaMetrics do make use of it yet. You can skip all the comments when importing in VM for now. But this may change in future.