1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
syntax = "proto3";
package lightstep.metrics;
option go_package = "metricspb";
option objc_class_prefix = "LSPB";
option java_multiple_files = true;
option java_package = "com.lightstep.tracer.grpc";
import "github.com/lightstep/lightstep-tracer-common/collector.proto";
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
// MetricKind indicates the semantics of the points (i.e. how to interpret values
// relative to each other).
enum MetricKind {
// InvalidMetricKind is the default value for the MetricKind. Some languages' proto compilers
// (e.g. Go) return the default if no value is set. The default is marked invalid here to
// avoid a common mistake where a field is left unset and appears to be set to the default.
INVALID_METRIC_KIND = 0;
// Counter metrics measure change over an interval.
// When aggregated, counter metrics are usually added.
COUNTER = 1;
// Gauge metrics measure the value at a point in time.
// When aggregated, intermediate values are often dropped for the latest value.
GAUGE = 2;
}
// MetricPoint is an update to a single measure.
message MetricPoint {
// Kind indicates the semantics of this point. Kind should always be the same for a given metric
// name (e.g. "cpu.usage" should always have the same kind)
MetricKind kind = 1;
// MetricName indicates the metric being emitted.
string metric_name = 2;
// Start of the interval for which the points represent.
// - All Counter points will be assumed to represent the entire interval.
// - All Gauge points will be assumed to be instantaneous at the start of the interval.
google.protobuf.Timestamp start = 3;
// Duration of the interval for which the points represent. The end of the interval is start + duration.
// We expect this value to be unset or zero for Gauge points.
google.protobuf.Duration duration = 4;
// Labels contain labels specific to this point.
repeated collector.KeyValue labels = 5;
// Value represents the update being emitted. Values can be one of two types: uint64 or double.
// The type of the value should always be the same for a given metric name (e.g. "cpu.usage"
// should always have value type double).
oneof value {
uint64 uint64_value = 6;
double double_value = 7;
}
}
// IngestRequest is an update to one or more measures.
message IngestRequest {
// IdempotencyKey is a random string that should uniquely identify this report.
// It should be generated once and used for all retries. The server will use it
// to de-duplicate requests.
string idempotency_key = 1;
// Reporter contains information to identify the specific originator of this report.
lightstep.collector.Reporter reporter = 2;
// Points contain the individual updates.
repeated MetricPoint points = 3;
}
// IngestResponse is reserved for future use.
message IngestResponse {}
service MetricsService {
rpc Report(IngestRequest) returns (IngestResponse) {
option (google.api.http) = {
post: "/metrics"
body: "*"
};
}
}
|