1
#pragma once
2

            
3
#include <string>
4

            
5
#include "source/common/singleton/const_singleton.h"
6

            
7
namespace Envoy {
8
namespace Tracing {
9

            
10
/**
11
 * Tracing tag names.
12
 */
13
class TracingTagValues {
14
public:
15
  // OpenTracing standard tag names.
16
  const std::string Component = "component";
17
  const std::string DbInstance = "db.instance";
18
  const std::string DbStatement = "db.statement";
19
  const std::string DbUser = "db.user";
20
  const std::string DbType = "db.type";
21
  const std::string Error = "error";
22
  const std::string HttpMethod = "http.method";
23
  const std::string HttpStatusCode = "http.status_code";
24
  const std::string HttpUrl = "http.url";
25
  const std::string MessageBusDestination = "message_bus.destination";
26
  // Downstream remote address for the downstream span and upstream remote address for the upstream
27
  // span.
28
  const std::string PeerAddress = "peer.address";
29
  const std::string PeerHostname = "peer.hostname";
30
  const std::string PeerIpv4 = "peer.ipv4";
31
  const std::string PeerIpv6 = "peer.ipv6";
32
  const std::string PeerPort = "peer.port";
33
  const std::string PeerService = "peer.service";
34
  const std::string SpanKind = "span.kind";
35

            
36
  // Non-standard tag names.
37
  const std::string DownstreamCluster = "downstream_cluster";
38
  const std::string ErrorReason = "error.reason";
39
  const std::string GrpcAuthority = "grpc.authority";
40
  const std::string GrpcContentType = "grpc.content_type";
41
  const std::string GrpcMessage = "grpc.message";
42
  const std::string GrpcPath = "grpc.path";
43
  const std::string GrpcStatusCode = "grpc.status_code";
44
  const std::string GrpcTimeout = "grpc.timeout";
45
  const std::string GuidXClientTraceId = "guid:x-client-trace-id";
46
  const std::string GuidXRequestId = "guid:x-request-id";
47
  const std::string HttpProtocol = "http.protocol";
48
  const std::string NodeId = "node_id";
49
  const std::string RequestSize = "request_size";
50
  const std::string ResponseFlags = "response_flags";
51
  const std::string ResponseSize = "response_size";
52
  const std::string RetryCount = "retry.count";
53
  const std::string Status = "status";
54
  const std::string UpstreamAddress = "upstream_address";
55
  const std::string UpstreamCluster = "upstream_cluster";
56
  const std::string UpstreamClusterName = "upstream_cluster.name";
57
  const std::string UserAgent = "user_agent";
58
  const std::string Zone = "zone";
59

            
60
  // Tag values.
61
  const std::string Canceled = "canceled";
62
  const std::string Proxy = "proxy";
63
  const std::string True = "true";
64
};
65

            
66
using Tags = ConstSingleton<TracingTagValues>;
67

            
68
class TracingLogValues {
69
public:
70
  // OpenTracing standard key names.
71
  const std::string EventKey = "event";
72

            
73
  // Event names
74
  const std::string LastDownstreamRxByteReceived = "last_downstream_rx_byte_received";
75
  const std::string FirstUpstreamTxByteSent = "first_upstream_tx_byte_sent";
76
  const std::string LastUpstreamTxByteSent = "last_upstream_tx_byte_sent";
77
  const std::string FirstUpstreamRxByteReceived = "first_upstream_rx_byte_received";
78
  const std::string LastUpstreamRxByteReceived = "last_upstream_rx_byte_received";
79
  const std::string FirstDownstreamTxByteSent = "first_downstream_tx_byte_sent";
80
  const std::string LastDownstreamTxByteSent = "last_downstream_tx_byte_sent";
81
};
82

            
83
using Logs = ConstSingleton<TracingLogValues>;
84

            
85
} // namespace Tracing
86
} // namespace Envoy