tarantool / tarantool/metrics

User may overwrite observations with special symbols

Open
#435 1 comment 0 reactions 1 assignee View on GitHub

@DifferentialOrange is already working on this.

Since Feb 6, 2023.

bug
Dominant language
Lua
Stars
40
Forks
28
Avg merge
15h 3m
Merged PRs (30d)
4

Description

Due to the implementation of internal storage, it is possible to overwrite existing observations if they have two or more labels:

tarantool> c = metrics.gauge('coll')
---
...

tarantool> c:set(3, {lab = 'val', lab2 = 'val2'})
---
...

tarantool> c:collect()
---
- - label_pairs:
      lab2: val2
      lab: val
    timestamp: 1675671598982881
    value: 3
    metric_name: coll
...

tarantool> c:set(4, {['lab\tval\tlab2'] = 'val2'})
---
...

tarantool> c:collect()
---
- - label_pairs:
      "lab\tval\tlab2": val2
    timestamp: 1675671636647270
    value: 4
    metric_name: coll
...

It is highly unlikely that someone would become a victim of this bug unintentionally, but this behavior still seems a bit problematic.

Moreover, using special symbols breaks prometheus export:

# HELP coll 
# TYPE coll gauge
coll{lab	val	lab2="val2"} 4
error while linting: text format parsing error in line 3: expected '=' after label name, found 'v'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.