Skip to content

Commit

Permalink
Prototype info PromQL function
Browse files Browse the repository at this point in the history
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
  • Loading branch information
aknuds1 committed May 19, 2024
1 parent 1380229 commit d630bdc
Show file tree
Hide file tree
Showing 50 changed files with 1,040 additions and 205 deletions.
5 changes: 5 additions & 0 deletions docs/querying/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ by the number of seconds under the specified time range window, and should be
used primarily for human readability. Use `rate` in recording rules so that
increases are tracked consistently on a per-second basis.

## `info()`

For each time series in `v`, `info(v instant-vector, [label-selector string])` finds all info metrics with corresponding
identifying labels, and adds the union of their data labels to the time series, that gets returned.

## `irate()`

`irate(v range-vector)` calculates the per-second instant rate of increase of
Expand Down
14 changes: 7 additions & 7 deletions prompb/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ message MetricMetadata {
}

message Sample {
double value = 1;
double value = 1;
// timestamp is in ms format, see model/timestamp/timestamp.go for
// conversion from time.Time to Prometheus timestamp.
int64 timestamp = 2;
int64 timestamp = 2;
// The set of identifying labels for info metrics, as array indices.
repeated int32 identifyingLabels = 3;
repeated int32 identifyingLabels = 3;
}

message Exemplar {
Expand Down Expand Up @@ -125,10 +125,10 @@ message BucketSpan {
message TimeSeries {
// For a timeseries to be valid, and for the samples and exemplars
// to be ingested by the remote system properly, the labels field is required.
repeated Label labels = 1 [(gogoproto.nullable) = false];
repeated Sample samples = 2 [(gogoproto.nullable) = false];
repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false];
repeated Histogram histograms = 4 [(gogoproto.nullable) = false];
repeated Label labels = 1 [(gogoproto.nullable) = false];
repeated Sample samples = 2 [(gogoproto.nullable) = false];
repeated Exemplar exemplars = 3 [(gogoproto.nullable) = false];
repeated Histogram histograms = 4 [(gogoproto.nullable) = false];
}

message Label {
Expand Down
Loading

0 comments on commit d630bdc

Please sign in to comment.