aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/grpcz/monitoring.proto
blob: ec3dfe9f74cfbe3458a06fb9f7d130841a8f85db (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
// Copyright 2017, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// This file defines an interface for exporting monitoring information
// out of gRPC servers.
syntax = "proto3";

// TODO(ericgribkoff) Figure out how to manage the external Census proto
// dependency.
import "tools/grpcz/census.proto";
import "tools/grpcz/empty.proto";
import "tools/grpcz/any.proto";

package grpc.instrumentation.v1alpha;

option java_multiple_files = true;
option java_package = "io.grpc.instrumentation.v1alpha";
option java_outer_classname = "MonitoringProto";

service Monitoring {
  // Return canonical RPC stats
  rpc GetCanonicalRpcStats(google.protobuf.Empty) returns (CanonicalRpcStats) {
  }

  // Query the server for specific stats
  rpc GetStats(StatsRequest) returns (StatsResponse) {
    // TODO(aveitch, ericgribkoff): Pease define the stats response message
    // StatsRequest would specifically identify the stats to be returned.
  }

  // Request the server to stream back snapshots of the requested stats
  rpc WatchStats(StatsRequest) returns (stream StatsResponse) {
  }


  // Return request traces.
  rpc GetRequestTraces(TraceRequest) returns(TraceResponse) {
  // TODO(aveitch): Please define the messages here
  }

  // Return application-defined groups of monitoring data.
  // This is a low level facility to allow extension of the monitoring API to
  // application-specific monitoring data. Frameworks may use this to define
  // additional groups of monitoring data made available by servers.
  rpc GetCustomMonitoringData(MonitoringDataGroup)
    returns (CustomMonitoringData) {
  }

}

// Canonical RPC stats exported by gRPC.
message CanonicalRpcStats {
  // Wrapper combining View and ViewDescriptor.
  message View {
    google.instrumentation.MeasurementDescriptor measurement_descriptor = 1;
    google.instrumentation.ViewDescriptor view_descriptor = 2;
    google.instrumentation.View view = 3;
  }

  View rpc_client_errors = 1;
  View rpc_client_completed_rpcs = 2;
  View rpc_client_started_rpcs = 3;
  View rpc_client_elapsed_time = 4;
  View rpc_client_server_elapsed_time = 5;
  View rpc_client_request_bytes = 6;
  View rpc_client_response_bytes = 7;
  View rpc_client_request_count = 8;
  View rpc_client_response_count = 9;
  View rpc_server_errors = 10;
  View rpc_server_completed_rpcs = 11;
  View rpc_server_server_elapsed_time = 12;
  View rpc_server_request_bytes = 13;
  View rpc_server_response_bytes = 14;
  View rpc_server_request_count = 15;
  View rpc_server_response_count = 16;
  View rpc_server_elapsed_time = 17;
  //TODO(ericgribkoff) Add minute-hour interval stats.
}

message StatsRequest {
  // TODO(aveitch): Complete definition of this type
}

message StatsResponse {
  // TODO(aveitch): Complete definition of this type
}

message TraceRequest {
  // TODO(aveitch): Complete definition of this type
}

message TraceResponse {
  // TODO(aveitch): Complete definition of this type
}

message MonitoringDataGroup {
  string name = 1;  // name of a group of monitoring data
}

// The wrapper for custom monitoring data.
message CustomMonitoringData {
  // can be any application specific monitoring data
  Any contents = 1;
}