blob: 23a1f748d889e4efc2728d0399a225b1ea62d423 [file]
// Monitoring implementations should include this file after defining the
// functions in milotic::metrics for explicit template instantiation. This is
// required so we don't need to include the implementation specific template
// definitions everywhere.
#ifndef THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRIC_INSTANCE_H_
#define THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRIC_INSTANCE_H_
#include <string>
#include "absl/strings/string_view.h"
#include "monitoring.h"
namespace milotic::metrics {
// Note on string field types:
// - Use `absl::string_view` ONLY for static strings (e.g. string literals)
// to avoid allocation.
// Example: constant HTTP verbs like "GET" or "POST".
// - Use `std::string` for dynamic or ephemeral strings to ensure the metric
// class owns the data and prevents Use-After-Free (UAF) bugs.
// Example: parsed hostnames or dynamic URIs.
// go/keep-sorted start
template class EventCounter<>;
template class EventCounter<absl::string_view, bool>;
template class EventCounter<absl::string_view, int>;
template class EventCounter<absl::string_view>;
template class EventCounter<int>;
template class EventCounter<std::string, int>;
template class Latency<>;
template class Latency<absl::string_view, absl::string_view>;
template class Latency<absl::string_view, int>;
template class Latency<absl::string_view, std::string>;
template class Latency<absl::string_view>;
template class Latency<std::string, int>;
template class Latency<std::string, std::string>;
template class State<>;
template class State<absl::string_view, int, int>;
template class State<std::string, int, int>;
// go/keep-sorted end
} // namespace milotic::metrics
#endif // THIRD_PARTY_MILOTIC_INTERNAL_CC_PROXY_METRIC_INSTANCE_H_