Skip to content

Commit

Permalink
Specify TSDB API in depth
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <[email protected]>
  • Loading branch information
aknuds1 committed May 24, 2024
1 parent 38c2743 commit 88feea2
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion proposals/2024-04-10-native-support-for-info-metrics-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,22 @@ Goals and use cases for the solution as proposed in [How](#how):
* Track when info metrics' set of identifying labels changes. This shouldn't be a frequent occurrence, but it should be handled.
* Automatically treat the old version of an info metric as stale for query result enriching purposes, when its data labels change (producing a new time series, but with same identity).
* Add TSDB API for, given a certain time series and a certain timestamp, getting data labels, potentially filtered by certain matchers, from info metrics with identifying labels in common with the time series in question.
* Simplify enriching of query results with info metric labels in PromQL, e.g. via a new function.
* If no data label matchers are provided, _all_ the data labels of found info metrics are added to the resulting time series.
* If data label matchers are provided, only info metrics with matching data labels are considered.
* If data label matchers are provided, _precisely_ the data labels specified by the label matchers are added to the returned time series.
* If data label matchers are provided, time series are only included in the result if matching data labels from info metrics were found.
* A data label matcher like `k8s_cluster_name=~".+"` guarantees that each returned time series has a non-empty `k8s_cluster_name` label, implying that time series for which no matching info metrics have a data label named `k8s_cluster_name` (including the case where no matching info metric exists at all) will be excluded from the result.
* A special case: If a data label matcher allows empty labels (equivalent to missing labels, e.g. `k8s_cluster_name=~".*"`), it will not exclude time series from the result even if there's no matching info metric.
* A data label matcher like `__name__="target_info"` can be used to restrict the info metrics used.
However, the `__name__` label itself will not be copied.
* Label collisions: The input instant vector could already contain labels that are also part of the data labels of a matching info metric.
Furthermore, since the info function might find multiple differently named info metrics with matching identifying labels, those might have overlapping data labels.
In this case, the info function has to check if the values of the affected labels match or are different.
The former case is not really a label collision and therefore causes no problem.
In the latter case, however, the function has to return an error.
The collision can be resolved by constraining the labels via the optional label-selector argument of the info function.
And of course, the user always has the option to go back to the original join syntax (or, even better, avoiding ingesting conflicting info metrics in the first place).
* Simplify enriching of query results with info metric data (non-identifying) labels in PromQL, e.g. via a new function, based on aforementioned TSDB API.

### Audience

Expand Down

0 comments on commit 88feea2

Please sign in to comment.