1// This file is copied (except for package name) from https://github.com/prometheus/prometheus/blob/master/storage/remote/remote.proto 2 3// Copyright 2016 Prometheus Team 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15 16syntax = "proto3"; 17 18package remote; 19 20message Sample { 21 double value = 1; 22 int64 timestamp_ms = 2; 23} 24 25message LabelPair { 26 string name = 1; 27 string value = 2; 28} 29 30message TimeSeries { 31 repeated LabelPair labels = 1; 32 // Sorted by time, oldest sample first. 33 repeated Sample samples = 2; 34} 35 36message WriteRequest { 37 repeated TimeSeries timeseries = 1; 38} 39 40message ReadRequest { 41 repeated Query queries = 1; 42} 43 44message ReadResponse { 45 // In same order as the request's queries. 46 repeated QueryResult results = 1; 47} 48 49message Query { 50 int64 start_timestamp_ms = 1; 51 int64 end_timestamp_ms = 2; 52 repeated LabelMatcher matchers = 3; 53} 54 55enum MatchType { 56 EQUAL = 0; 57 NOT_EQUAL = 1; 58 REGEX_MATCH = 2; 59 REGEX_NO_MATCH = 3; 60} 61 62message LabelMatcher { 63 MatchType type = 1; 64 string name = 2; 65 string value = 3; 66} 67 68message QueryResult { 69 repeated TimeSeries timeseries = 1; 70}