syntax = "proto3";

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

package sensu.core.v2;

option go_package = "v2";
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.testgen_all) = true;

// A Metrics is an event metrics payload specification.
message Metrics {
  // Handlers is a list of handlers for the metric points.
  repeated string handlers = 1 [(gogoproto.jsontag) = "handlers"];

  // Points is a list of metric points (measurements).
  repeated MetricPoint points = 2 [(gogoproto.jsontag) = "points"];
}

// A MetricPoint represents a single measurement.
message MetricPoint {
  // The metric point name.
  string name = 1;

  // The metric point value.
  double value = 2 [(gogoproto.jsontag) = "value"];

  // The metric point timestamp, time in nanoseconds since the Epoch.
  int64 timestamp = 3 [(gogoproto.jsontag) = "timestamp"];

  // Tags is a list of metric tags (dimensions).
  repeated MetricTag tags = 4 [(gogoproto.jsontag) = "tags"];
}

// A MetricTag adds a dimension to a metric point.
message MetricTag {
  // The metric tag name.
  string name = 1;

  // The metric tag value.
  string value = 2;
}
