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 <set> 19 #include <string> 20 21 namespace grpc_observability { 22 23 const std::string kClientMethod = "grpc.method"; 24 const std::string kClientTarget = "grpc.target"; 25 const std::string kClientStatus = "grpc.status"; 26 const std::string kServerMethod = "grpc.method"; 27 const std::string kServerStatus = "grpc.status"; 28 const std::string kRegisteredMethod = "registerMethod"; 29 const std::string kXEnvoyPeerMetadata = "XEnvoyPeerMetadata"; 30 31 typedef enum { kMeasurementDouble = 0, kMeasurementInt } MeasurementType; 32 33 typedef enum { kSpanData = 0, kMetricData } DataType; 34 35 typedef enum { 36 kRpcClientApiLatencyMeasureName = 0, 37 kRpcClientSentMessagesPerRpcMeasureName, 38 kRpcClientSentBytesPerRpcMeasureName, 39 kRpcClientReceivedMessagesPerRpcMeasureName, 40 kRpcClientReceivedBytesPerRpcMeasureName, 41 kRpcClientRoundtripLatencyMeasureName, 42 kRpcClientCompletedRpcMeasureName, 43 kRpcClientServerLatencyMeasureName, 44 kRpcClientStartedRpcsMeasureName, 45 kRpcClientRetriesPerCallMeasureName, 46 kRpcClientTransparentRetriesPerCallMeasureName, 47 kRpcClientRetryDelayPerCallMeasureName, 48 kRpcClientTransportLatencyMeasureName, 49 kRpcServerSentMessagesPerRpcMeasureName, 50 kRpcServerSentBytesPerRpcMeasureName, 51 kRpcServerReceivedMessagesPerRpcMeasureName, 52 kRpcServerReceivedBytesPerRpcMeasureName, 53 kRpcServerServerLatencyMeasureName, 54 kRpcServerCompletedRpcMeasureName, 55 kRpcServerStartedRpcsMeasureName 56 } MetricsName; 57 58 const std::set<std::string> MetadataExchangeKeyNames = {kXEnvoyPeerMetadata}; 59 60 } // namespace grpc_observability 61 62 #endif // GRPC_PYTHON_OBSERVABILITY_CONSTANTS_H 63