1
#pragma once
2

            
3
#include <regex>
4

            
5
#include "envoy/admin/v3/server_info.pb.h"
6
#include "envoy/init/manager.h"
7

            
8
#include "source/common/http/codes.h"
9
#include "source/common/http/header_map_impl.h"
10
#include "source/common/http/utility.h"
11

            
12
namespace Envoy {
13
namespace Server {
14
namespace Utility {
15

            
16
// HistogramBucketsMode determines how histogram statistics get reported. Not
17
// all modes are supported for all formats, with the "Unset" variant allowing
18
// different formats to have different default behavior.
19
enum class HistogramBucketsMode {
20
  Unset,
21
  Summary,
22
  Cumulative,
23
  Disjoint,
24
  Detailed,
25
  PrometheusNative
26
};
27

            
28
void populateFallbackResponseHeaders(Http::Code code, Http::ResponseHeaderMap& header_map);
29

            
30
absl::Status histogramBucketsParam(const Http::Utility::QueryParamsMulti& params,
31
                                   HistogramBucketsMode& histogram_buckets_mode);
32

            
33
absl::optional<std::string> formatParam(const Http::Utility::QueryParamsMulti& params);
34

            
35
absl::optional<std::string> nonEmptyQueryParam(const Http::Utility::QueryParamsMulti& params,
36
                                               const std::string& key);
37

            
38
} // namespace Utility
39
} // namespace Server
40
} // namespace Envoy