aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/googleapis/google/monitoring/v3/metric_service.proto
blob: 0dd0b19d3156effdf5a663f4f9f9423be17041f0 (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.monitoring.v3;

import "google/api/annotations.proto";
import "google/api/metric.proto";
import "google/api/monitored_resource.proto";
import "google/monitoring/v3/common.proto";
import "google/monitoring/v3/metric.proto";
import "google/protobuf/empty.proto";
import "google/rpc/status.proto";

option csharp_namespace = "Google.Cloud.Monitoring.V3";
option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
option java_multiple_files = true;
option java_outer_classname = "MetricServiceProto";
option java_package = "com.google.monitoring.v3";


// Manages metric descriptors, monitored resource descriptors, and
// time series data.
service MetricService {
  // Lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
  rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) {
    option (google.api.http) = { get: "/v3/{name=projects/*}/monitoredResourceDescriptors" };
  }

  // Gets a single monitored resource descriptor. This method does not require a Stackdriver account.
  rpc GetMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest) returns (google.api.MonitoredResourceDescriptor) {
    option (google.api.http) = { get: "/v3/{name=projects/*/monitoredResourceDescriptors/*}" };
  }

  // Lists metric descriptors that match a filter. This method does not require a Stackdriver account.
  rpc ListMetricDescriptors(ListMetricDescriptorsRequest) returns (ListMetricDescriptorsResponse) {
    option (google.api.http) = { get: "/v3/{name=projects/*}/metricDescriptors" };
  }

  // Gets a single metric descriptor. This method does not require a Stackdriver account.
  rpc GetMetricDescriptor(GetMetricDescriptorRequest) returns (google.api.MetricDescriptor) {
    option (google.api.http) = { get: "/v3/{name=projects/*/metricDescriptors/**}" };
  }

  // Creates a new metric descriptor.
  // User-created metric descriptors define
  // [custom metrics](/monitoring/custom-metrics).
  rpc CreateMetricDescriptor(CreateMetricDescriptorRequest) returns (google.api.MetricDescriptor) {
    option (google.api.http) = { post: "/v3/{name=projects/*}/metricDescriptors" body: "metric_descriptor" };
  }

  // Deletes a metric descriptor. Only user-created
  // [custom metrics](/monitoring/custom-metrics) can be deleted.
  rpc DeleteMetricDescriptor(DeleteMetricDescriptorRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { delete: "/v3/{name=projects/*/metricDescriptors/**}" };
  }

  // Lists time series that match a filter. This method does not require a Stackdriver account.
  rpc ListTimeSeries(ListTimeSeriesRequest) returns (ListTimeSeriesResponse) {
    option (google.api.http) = { get: "/v3/{name=projects/*}/timeSeries" };
  }

  // Creates or adds data to one or more time series.
  // The response is empty if all time series in the request were written.
  // If any time series could not be written, a corresponding failure message is
  // included in the error response.
  rpc CreateTimeSeries(CreateTimeSeriesRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { post: "/v3/{name=projects/*}/timeSeries" body: "*" };
  }
}

// The `ListMonitoredResourceDescriptors` request.
message ListMonitoredResourceDescriptorsRequest {
  // The project on which to execute the request. The format is
  // `"projects/{project_id_or_number}"`.
  string name = 5;

  // An optional [filter](/monitoring/api/v3/filters) describing
  // the descriptors to be returned.  The filter can reference
  // the descriptor's type and labels. For example, the
  // following filter returns only Google Compute Engine descriptors
  // that have an `id` label:
  //
  //     resource.type = starts_with("gce_") AND resource.label:id
  string filter = 2;

  // A positive number that is the maximum number of results to return.
  int32 page_size = 3;

  // If this field is not empty then it must contain the `nextPageToken` value
  // returned by a previous call to this method.  Using this field causes the
  // method to return additional results from the previous method call.
  string page_token = 4;
}

// The `ListMonitoredResourcDescriptors` response.
message ListMonitoredResourceDescriptorsResponse {
  // The monitored resource descriptors that are available to this project
  // and that match `filter`, if present.
  repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1;

  // If there are more results than have been returned, then this field is set
  // to a non-empty value.  To see the additional results,
  // use that value as `pageToken` in the next call to this method.
  string next_page_token = 2;
}

// The `GetMonitoredResourceDescriptor` request.
message GetMonitoredResourceDescriptorRequest {
  // The monitored resource descriptor to get.  The format is
  // `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`.
  // The `{resource_type}` is a predefined type, such as
  // `cloudsql_database`.
  string name = 3;
}

// The `ListMetricDescriptors` request.
message ListMetricDescriptorsRequest {
  // The project on which to execute the request. The format is
  // `"projects/{project_id_or_number}"`.
  string name = 5;

  // If this field is empty, all custom and
  // system-defined metric descriptors are returned.
  // Otherwise, the [filter](/monitoring/api/v3/filters)
  // specifies which metric descriptors are to be
  // returned. For example, the following filter matches all
  // [custom metrics](/monitoring/custom-metrics):
  //
  //     metric.type = starts_with("custom.googleapis.com/")
  string filter = 2;

  // A positive number that is the maximum number of results to return.
  int32 page_size = 3;

  // If this field is not empty then it must contain the `nextPageToken` value
  // returned by a previous call to this method.  Using this field causes the
  // method to return additional results from the previous method call.
  string page_token = 4;
}

// The `ListMetricDescriptors` response.
message ListMetricDescriptorsResponse {
  // The metric descriptors that are available to the project
  // and that match the value of `filter`, if present.
  repeated google.api.MetricDescriptor metric_descriptors = 1;

  // If there are more results than have been returned, then this field is set
  // to a non-empty value.  To see the additional results,
  // use that value as `pageToken` in the next call to this method.
  string next_page_token = 2;
}

// The `GetMetricDescriptor` request.
message GetMetricDescriptorRequest {
  // The metric descriptor on which to execute the request. The format is
  // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`.
  // An example value of `{metric_id}` is
  // `"compute.googleapis.com/instance/disk/read_bytes_count"`.
  string name = 3;
}

// The `CreateMetricDescriptor` request.
message CreateMetricDescriptorRequest {
  // The project on which to execute the request. The format is
  // `"projects/{project_id_or_number}"`.
  string name = 3;

  // The new [custom metric](/monitoring/custom-metrics)
  // descriptor.
  google.api.MetricDescriptor metric_descriptor = 2;
}

// The `DeleteMetricDescriptor` request.
message DeleteMetricDescriptorRequest {
  // The metric descriptor on which to execute the request. The format is
  // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`.
  // An example of `{metric_id}` is:
  // `"custom.googleapis.com/my_test_metric"`.
  string name = 3;
}

// The `ListTimeSeries` request.
message ListTimeSeriesRequest {
  // Controls which fields are returned by `ListTimeSeries`.
  enum TimeSeriesView {
    // Returns the identity of the metric(s), the time series,
    // and the time series data.
    FULL = 0;

    // Returns the identity of the metric and the time series resource,
    // but not the time series data.
    HEADERS = 1;
  }

  // The project on which to execute the request. The format is
  // "projects/{project_id_or_number}".
  string name = 10;

  // A [monitoring filter](/monitoring/api/v3/filters) that specifies which time
  // series should be returned.  The filter must specify a single metric type,
  // and can additionally specify metric labels and other information. For
  // example:
  //
  //     metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
  //         metric.label.instance_name = "my-instance-name"
  string filter = 2;

  // The time interval for which results should be returned. Only time series
  // that contain data points in the specified interval are included
  // in the response.
  TimeInterval interval = 4;

  // By default, the raw time series data is returned.
  // Use this field to combine multiple time series for different
  // views of the data.
  Aggregation aggregation = 5;

  // Specifies the order in which the points of the time series should
  // be returned.  By default, results are not ordered.  Currently,
  // this field must be left blank.
  string order_by = 6;

  // Specifies which information is returned about the time series.
  TimeSeriesView view = 7;

  // A positive number that is the maximum number of results to return.
  // When `view` field sets to `FULL`, it limits the number of `Points` server
  // will return; if `view` field is `HEADERS`, it limits the number of
  // `TimeSeries` server will return.
  int32 page_size = 8;

  // If this field is not empty then it must contain the `nextPageToken` value
  // returned by a previous call to this method.  Using this field causes the
  // method to return additional results from the previous method call.
  string page_token = 9;
}

// The `ListTimeSeries` response.
message ListTimeSeriesResponse {
  // One or more time series that match the filter included in the request.
  repeated TimeSeries time_series = 1;

  // If there are more results than have been returned, then this field is set
  // to a non-empty value.  To see the additional results,
  // use that value as `pageToken` in the next call to this method.
  string next_page_token = 2;
}

// The `CreateTimeSeries` request.
message CreateTimeSeriesRequest {
  // The project on which to execute the request. The format is
  // `"projects/{project_id_or_number}"`.
  string name = 3;

  // The new data to be added to a list of time series.
  // Adds at most one data point to each of several time series.  The new data
  // point must be more recent than any other point in its time series.  Each
  // `TimeSeries` value must fully specify a unique time series by supplying
  // all label values for the metric and the monitored resource.
  repeated TimeSeries time_series = 2;
}

// Describes the result of a failed request to write data to a time series.
message CreateTimeSeriesError {
  // The time series, including the `Metric`, `MonitoredResource`,
  // and `Point`s (including timestamp and value) that resulted
  // in the error. This field provides all of the context that
  // would be needed to retry the operation.
  TimeSeries time_series = 1;

  // The status of the requested write operation.
  google.rpc.Status status = 2;
}