Skip to content

Commit bce6d9c

Browse files
committed
add future extension to handle type and unit in promql operations
Signed-off-by: David Ashpole <[email protected]>
1 parent f1760bd commit bce6d9c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: proposals/2024-09-25_metadata-labels.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Users see no difference to exposition formats.
6464

6565
When a query for a metric returns multiple metrics with a different `__type__` or `__unit__` label, but the same `__name__`, an info annotation will be returned with the PromQL response, which is otherwise unmodified.
6666

67-
Aggregations and label matches ignore `__unit__` and `__type__` and any operation would remove the `__unit__` and `__type__` label (with the exception of label_replace).
67+
Aggregations and label matches ignore `__unit__` and `__type__` and any operation removes the `__unit__` and `__type__` label (with the exception of `label_replace`).
6868

6969
### Prometheus UI Changes
7070

@@ -147,6 +147,10 @@ The `_count` series of histograms and summaries could omit the `__unit__` label
147147

148148
## Potential Future Extensions
149149

150+
### Handle __type__ and __unit__ in PromQL operations
151+
152+
Initially, aggregations and label matches will ignore `__unit__` and `__type__` and all PromQL operations remove the `__unit__` and `__type__` label (with the exception of `label_replace`). Over time, we can update each function to keep these labels by implementing the appropriate logic. For example, adding two gauges together should yeild a gauge.
153+
150154
### __type__ and __unit__ from client libraries
151155

152156
One obvious extension of this proposal would be for Prometheus clients to start sending `__type__` and `__unit__` labels with the exposition format. This would:

0 commit comments

Comments
 (0)