Skip to content

Commit

Permalink
update prom remote write for bulk timers (#38)
Browse files Browse the repository at this point in the history
Also do some cleanup of stuff we don't need.

Signed-off-by: Matt Klein <[email protected]>
  • Loading branch information
mattklein123 authored Jan 19, 2025
1 parent 45ed6e6 commit 03eedbe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 311 deletions.
144 changes: 0 additions & 144 deletions thirdparty/gogoproto/gogo.proto

This file was deleted.

147 changes: 0 additions & 147 deletions thirdparty/prometheus/prompb/io/prometheus/client/metrics.proto

This file was deleted.

9 changes: 3 additions & 6 deletions thirdparty/prometheus/prompb/remote.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@
syntax = "proto3";
package prometheus;

option go_package = "prompb";

import "prometheus/prompb/types.proto";
import "gogoproto/gogo.proto";

message WriteRequest {
repeated prometheus.TimeSeries timeseries = 1 [(gogoproto.nullable) = false];
repeated prometheus.TimeSeries timeseries = 1;
// Cortex uses this field to determine the source of the write request.
// We reserve it to avoid any compatibility issues.
reserved 2;
repeated prometheus.MetricMetadata metadata = 3 [(gogoproto.nullable) = false];
repeated prometheus.MetricMetadata metadata = 3;

// Added as an extension, this field allows us to forward statsd PDUs that fail to parse.
repeated string failthrough_statsd_lines = 17;
Expand Down Expand Up @@ -86,4 +83,4 @@ message ChunkedReadResponse {

// query_index represents an index of the query from ReadRequest.queries these chunks relates to.
int64 query_index = 2;
}
}
29 changes: 15 additions & 14 deletions thirdparty/prometheus/prompb/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
syntax = "proto3";
package prometheus;

option go_package = "prompb";

import "gogoproto/gogo.proto";

message MetricMetadata {
enum MetricType {
UNKNOWN = 0;
Expand All @@ -29,9 +25,12 @@ message MetricMetadata {
INFO = 6;
STATESET = 7;

// added as extensions
// bitdrift extensions
DIRECTGAUGE = 100;
DELTAGAUGE = 101;
TIMER = 102;
BULKTIMER = 103;
DIRECTCOUNTER = 104;
}

// Represents the metric type, these match the set from Prometheus.
Expand All @@ -48,13 +47,15 @@ message Sample {
// conversion from time.Time to Prometheus timestamp.
int64 timestamp = 2;

// added as an extension, sample_rate is a ratio in the range (0,1].
// bitdrift extension: sample_rate is a ratio in the range (0,1].
double sample_rate = 100;
// bitdrift extension: bulk values used for the bulk timer metric type.
repeated double bulk_values = 101;
}

message Exemplar {
// Optional, can be empty.
repeated Label labels = 1 [(gogoproto.nullable) = false];
repeated Label labels = 1;
double value = 2;
// timestamp is in ms format, see model/timestamp/timestamp.go for
// conversion from time.Time to Prometheus timestamp.
Expand All @@ -65,9 +66,9 @@ message Exemplar {
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 Label labels = 1;
repeated Sample samples = 2;
repeated Exemplar exemplars = 3;
}

message Label {
Expand All @@ -76,7 +77,7 @@ message Label {
}

message Labels {
repeated Label labels = 1 [(gogoproto.nullable) = false];
repeated Label labels = 1;
}

// Matcher specifies a rule, which can match or set of labels or not.
Expand Down Expand Up @@ -120,7 +121,7 @@ message Chunk {
// ChunkedSeries represents single, encoded time series.
message ChunkedSeries {
// Labels should be sorted.
repeated Label labels = 1 [(gogoproto.nullable) = false];
repeated Label labels = 1;
// Chunks will be in start time order and may overlap.
repeated Chunk chunks = 2 [(gogoproto.nullable) = false];
}
repeated Chunk chunks = 2;
}

0 comments on commit 03eedbe

Please sign in to comment.