xref: /aosp_15_r20/external/grpc-grpc/src/python/grpcio_observability/grpc_observability/constants.h (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1 // Copyright 2023 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef GRPC_PYTHON_OBSERVABILITY_CONSTANTS_H
16 #define GRPC_PYTHON_OBSERVABILITY_CONSTANTS_H
17 
18 #include <string>
19 
20 namespace grpc_observability {
21 
22 const std::string kClientMethod = "grpc.method";
23 const std::string kClientTarget = "grpc.target";
24 const std::string kClientStatus = "grpc.status";
25 const std::string kServerMethod = "grpc.method";
26 const std::string kServerStatus = "grpc.status";
27 
28 typedef enum { kMeasurementDouble = 0, kMeasurementInt } MeasurementType;
29 
30 typedef enum { kSpanData = 0, kMetricData } DataType;
31 
32 typedef enum {
33   kRpcClientApiLatencyMeasureName = 0,
34   kRpcClientSentMessagesPerRpcMeasureName,
35   kRpcClientSentBytesPerRpcMeasureName,
36   kRpcClientReceivedMessagesPerRpcMeasureName,
37   kRpcClientReceivedBytesPerRpcMeasureName,
38   kRpcClientRoundtripLatencyMeasureName,
39   kRpcClientCompletedRpcMeasureName,
40   kRpcClientServerLatencyMeasureName,
41   kRpcClientStartedRpcsMeasureName,
42   kRpcClientRetriesPerCallMeasureName,
43   kRpcClientTransparentRetriesPerCallMeasureName,
44   kRpcClientRetryDelayPerCallMeasureName,
45   kRpcClientTransportLatencyMeasureName,
46   kRpcServerSentMessagesPerRpcMeasureName,
47   kRpcServerSentBytesPerRpcMeasureName,
48   kRpcServerReceivedMessagesPerRpcMeasureName,
49   kRpcServerReceivedBytesPerRpcMeasureName,
50   kRpcServerServerLatencyMeasureName,
51   kRpcServerCompletedRpcMeasureName,
52   kRpcServerStartedRpcsMeasureName
53 } MetricsName;
54 
55 }  // namespace grpc_observability
56 
57 #endif  // GRPC_PYTHON_OBSERVABILITY_CONSTANTS_H
58