1
#include "source/common/tls/stats.h"
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
7098
SslStats generateSslStats(Stats::Scope& store) {
12
7098
  std::string prefix("ssl.");
13
7098
  return {ALL_SSL_STATS(POOL_COUNTER_PREFIX(store, prefix), POOL_GAUGE_PREFIX(store, prefix),
14
7098
                        POOL_HISTOGRAM_PREFIX(store, prefix))};
15
7098
}
16

            
17
11196
Stats::Gauge& createCertificateExpirationGauge(Stats::Scope& scope, const std::string& cert_name) {
18
11196
  const std::string full_stat_name =
19
11196
      absl::StrCat("ssl.certificate.", cert_name, ".expiration_unix_time_seconds");
20

            
21
11196
  return Stats::Utility::gaugeFromElements(scope, {Stats::DynamicName(full_stat_name)},
22
11196
                                           Stats::Gauge::ImportMode::NeverImport);
23
11196
}
24

            
25
} // namespace Tls
26
} // namespace TransportSockets
27
} // namespace Extensions
28
} // namespace Envoy