elastic / elastic/logstash

Optionally expose the unit of metric via the Metrics API.

Open
#7,646 0 comments 0 reactions 0 assignees View on GitHub
discuss metrics
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

As more metrics are exposed we should allow for an optional flag to expose the underlying unit to caller. Perhaps ```?unit=true```.

This may allow the consumer of the metrics to make a more informed choice about what to do with these metrics.

For example:
```
"pipelines" : {
"main" : {
"events" : {
"duration_in_millis" : 59,
```
Could optionally be:
```
"pipelines" : {
"main" : {
"events" : {
"duration_in_millis" : {
"unit" : "ms",
"value" : 59
},
```

When combined with https://github.com/elastic/logstash/issues/7645, could result in ```?unit=true&type=true```.
```
"pipelines" : {
"main" : {
"events" : {
"duration_in_millis" : {
"type" : "counter/long",
"unit" : "ms",
"value" : 59
},
```
The above example is a bit redundant, but by exposing the unit, we can avoid requiring the unit to be encoded into the name, and allows for consumers to do smarter things programmatically such as convert ms to seconds for easier reading.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.