tarantool / metrics

Metric collection library for Tarantool
MIT License
39 stars 23 forks source link

Prometeus exporter assumes that fiber.time64() is unsigned #356

Closed Totktonada closed 2 years ago

Totktonada commented 2 years ago

However it is not so anymore (since tarantool 2.10.0-rc1): https://github.com/tarantool/tarantool/pull/5989.

How it fails:

Failed tests:
-------------

1) plugins.graphite.test_graphite_format_observation_time_in_seconds
...ts/tarantool-meta/metrics/test/plugins/graphite_test.lua:105: expected: 1650916834LL, actual: 165091683
stack traceback:
    ...ts/tarantool-meta/metrics/test/plugins/graphite_test.lua:105: in function 'plugins.graphite.test_graphite_format_observation_time_in_seconds'
    ...
    [C]: in function 'xpcall'

Ran 1 tests in 0.062 seconds, 0 succeeded, 1 failed, 135 not selected

The problem is here:

https://github.com/tarantool/metrics/blob/f00849f08bb5f80f2014f8eb2c854949a6d55648/metrics/plugins/graphite.lua#L33

The number is \d+LL now, not \d+ULL. If we'll replace -10 with -9, the test will pass on the fresh tarantool (but obviously will fail on an old tarantool).