Skip to content

User may overwrite observations with special symbols #435

Open
@DifferentialOrange

Description

@DifferentialOrange

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'

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions