syntax = "proto3";

package conduit.controller.telemetry;

import "public/api.proto";

/// Telemetry Service ///
//
// Internal Telemetry Service read API

service Telemetry {
  rpc Query(QueryRequest) returns (QueryResponse) {}
  rpc ListPods(ListPodsRequest) returns (public.ListPodsResponse) {}
}

message QueryRequest {
  // required
  string query = 1;

  // required for timeseries queries
  int64 start_ms = 2;

  // required for timeseries queries
  // optional for single data point, but if unset, results will have non-deterministic timestamps
  int64 end_ms = 3;

  // required for timeseries queries
  string step = 4;
}

message QueryResponse {
  repeated Sample metrics = 1;
}

message Sample {
  repeated SampleValue values = 1;
  map<string, string> labels = 2;
}

message SampleValue {
  double value = 1;
  int64 timestamp_ms = 2;
}

message ListPodsRequest {}
