1
#pragma once
2

            
3
#include "envoy/stats/scope.h"
4
#include "envoy/stats/stats_macros.h"
5

            
6
namespace Envoy {
7
namespace Extensions {
8
namespace TransportSockets {
9
namespace Tls {
10

            
11
#define ALL_SSL_STATS(COUNTER, GAUGE, HISTOGRAM)                                                   \
12
7098
  COUNTER(connection_error)                                                                        \
13
7098
  COUNTER(handshake)                                                                               \
14
7098
  COUNTER(session_reused)                                                                          \
15
7098
  COUNTER(no_certificate)                                                                          \
16
7098
  COUNTER(fail_verify_no_cert)                                                                     \
17
7098
  COUNTER(fail_verify_error)                                                                       \
18
7098
  COUNTER(fail_verify_san)                                                                         \
19
7098
  COUNTER(fail_verify_cert_hash)                                                                   \
20
7098
  COUNTER(ocsp_staple_failed)                                                                      \
21
7098
  COUNTER(ocsp_staple_omitted)                                                                     \
22
7098
  COUNTER(ocsp_staple_responses)                                                                   \
23
7098
  COUNTER(ocsp_staple_requests)                                                                    \
24
7098
  COUNTER(was_key_usage_invalid)
25

            
26
/**
27
 * Wrapper struct for SSL stats. @see stats_macros.h
28
 */
29
struct SslStats {
30
  ALL_SSL_STATS(GENERATE_COUNTER_STRUCT, GENERATE_GAUGE_STRUCT, GENERATE_HISTOGRAM_STRUCT)
31
};
32

            
33
SslStats generateSslStats(Stats::Scope& store);
34

            
35
Stats::Gauge& createCertificateExpirationGauge(Stats::Scope& scope, const std::string& cert_name);
36

            
37
} // namespace Tls
38
} // namespace TransportSockets
39
} // namespace Extensions
40
} // namespace Envoy