Documentation ¶
Index ¶
- Constants
- Variables
- type HeaderBypassResponseWriter
- type IMerger
- type Merger
- func (m *Merger) Add(pluginName string, unixDomainSocket string)
- func (m *Merger) MergeMetrics(pluginMetrics map[string][]byte) *gerr.GatewayDError
- func (m *Merger) ReadMetrics() (map[string][]byte, *gerr.GatewayDError)
- func (m *Merger) Remove(pluginName string)
- func (m *Merger) Start()
- func (m *Merger) Stop()
Constants ¶
View Source
const (
Namespace = "gatewayd"
)
Variables ¶
View Source
var ( ClientConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Name: "client_connections", Help: "Number of client connections", }, []string{"group", "block"}) ServerConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Name: "server_connections", Help: "Number of server connections", }, []string{"group", "block"}) TLSConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Name: "tls_connections", Help: "Number of TLS connections", }, []string{"group", "block"}) ServerTicksFired = promauto.NewCounter(prometheus.CounterOpts{ Namespace: Namespace, Name: "server_ticks_fired_total", Help: "Total number of server ticks fired", }) BytesReceivedFromClient = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: Namespace, Name: "bytes_received_from_client", Help: "Number of bytes received from client", }, []string{"group", "block"}) BytesSentToServer = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: Namespace, Name: "bytes_sent_to_server", Help: "Number of bytes sent to server", }, []string{"group", "block"}) BytesReceivedFromServer = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: Namespace, Name: "bytes_received_from_server", Help: "Number of bytes received from server", }, []string{"group", "block"}) BytesSentToClient = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: Namespace, Name: "bytes_sent_to_client", Help: "Number of bytes sent to client", }, []string{"group", "block"}) TotalTrafficBytes = promauto.NewSummaryVec(prometheus.SummaryOpts{ Namespace: Namespace, Name: "traffic_bytes", Help: "Number of total bytes passed through GatewayD via client or server", }, []string{"group", "block"}) PluginsLoaded = promauto.NewCounter(prometheus.CounterOpts{ Namespace: Namespace, Name: "plugins_loaded_total", Help: "Number of plugins loaded", }) PluginHooksRegistered = promauto.NewCounter(prometheus.CounterOpts{ Namespace: Namespace, Name: "plugin_hooks_registered_total", Help: "Number of plugin hooks registered", }) PluginHooksExecuted = promauto.NewCounter(prometheus.CounterOpts{ Namespace: Namespace, Name: "plugin_hooks_executed_total", Help: "Number of plugin hooks executed", }) ProxyHealthChecks = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "proxy_health_checks_total", Help: "Number of proxy health checks", }, []string{"group", "block"}) ProxiedConnections = promauto.NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Name: "proxied_connections", Help: "Number of proxy connects", }, []string{"group", "block"}) ProxyPassThroughsToClient = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "proxy_passthroughs_to_client_total", Help: "Number of successful proxy passthroughs from server to client", }, []string{"group", "block"}) ProxyPassThroughsToServer = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "proxy_passthroughs_to_server_total", Help: "Number of successful proxy passthroughs from client to server", }, []string{"group", "block"}) ProxyPassThroughTerminations = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "proxy_passthrough_terminations_total", Help: "Number of proxy passthrough terminations by plugins", }, []string{"group", "block"}) APIRequests = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "api_requests_total", Help: "Number of API requests", }, []string{"method", "endpoint"}) APIRequestsErrors = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: Namespace, Name: "api_requests_errors_total", Help: "Number of API request errors", }, []string{"method", "endpoint", "error"}) )
Functions ¶
This section is empty.
Types ¶
type HeaderBypassResponseWriter ¶ added in v0.8.1
type HeaderBypassResponseWriter struct {
http.ResponseWriter
}
HeaderBypassResponseWriter implements the http.ResponseWriter interface and allows us to bypass the response header when writing to the response. This is useful for merging metrics from multiple sources.
func (*HeaderBypassResponseWriter) Write ¶ added in v0.8.1
func (w *HeaderBypassResponseWriter) Write(data []byte) (int, error)
Write writes the data to the response.
func (*HeaderBypassResponseWriter) WriteHeader ¶ added in v0.8.1
func (w *HeaderBypassResponseWriter) WriteHeader(int)
WriteHeader intentionally does nothing, but is required to implement the http.ResponseWriter.
type Merger ¶
type Merger struct { Logger zerolog.Logger MetricsMergerPeriod time.Duration Addresses map[string]string OutputMetrics []byte // contains filtered or unexported fields }
func (*Merger) Add ¶
Add adds a plugin and its unix domain socket to the map of plugins to merge metrics from.
func (*Merger) MergeMetrics ¶ added in v0.3.1
func (m *Merger) MergeMetrics(pluginMetrics map[string][]byte) *gerr.GatewayDError
func (*Merger) ReadMetrics ¶
func (m *Merger) ReadMetrics() (map[string][]byte, *gerr.GatewayDError)
ReadMetrics reads metrics from plugins by reading from their unix domain sockets.
Click to show internal directories.
Click to hide internal directories.