Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SignalReadingMetricName - used in circuit metrics. SignalReadingMetricName = "signal_reading" // FluxMeterMetricName name of fluxmeter metrics. FluxMeterMetricName = "flux_meter" // WorkloadLatencyMetricName - metric used for grouping latencies per workload. WorkloadLatencyMetricName = "workload_latency_ms" // RequestCounterMetricName - metric from http server. RequestCounterMetricName = "http_server_request_counter" // ErrorCountMetricName - metric from http server. ErrorCountMetricName = "http_server_error_counter" // LatencyHistogramMetricName - metric from http server. LatencyHistogramMetricName = "http_server_request_latency_seconds" // AcceptedConcurrencyMetricName - metric for measuring latencies of accepted requests. AcceptedConcurrencyMetricName = "accepted_concurrency" // IncomingConcurrencyMetricName - metric for measuring latencies of all incoming requests. IncomingConcurrencyMetricName = "incoming_concurrency" // WorkloadLatencySumMetricName - metric from workload histogram. WorkloadLatencySumMetricName = "workload_latency_ms_sum" // WorkloadLatencyCountMetricName - metric from workload histogram. WorkloadLatencyCountMetricName = "workload_latency_ms_count" // WFQFlowsMetricName - weighted fair queuing number of flows gauge. WFQFlowsMetricName = "wfq_flows" // WFQRequestsMetricName - weighted fair queuing number of requests gauge. WFQRequestsMetricName = "wfq_requests" // PolicyNameLabel - label used in prometheus. PolicyNameLabel = "policy_name" // PolicyHashLabel - label used in prometheus. PolicyHashLabel = "policy_hash" // ComponentIndexLabel - index of component in circuit label. ComponentIndexLabel = "component_index" // DecisionTypeLabel - label for decision type dropped or accepted. DecisionTypeLabel = "decision_type" // WorkloadIndexLabel - label for choosing correct workload. WorkloadIndexLabel = "workload_index" // SignalNameLabel - label for saving circuit signal metrics. SignalNameLabel = "signal_name" // FluxMeterNameLabel - specifying flux meter's name. FluxMeterNameLabel = "flux_meter_name" // StatusCodeLabel - http/library return code. StatusCodeLabel = "status_code" // MethodLabel - label from http method. MethodLabel = "method" // ResponseStatusCodeLabel - label from response status code. ResponseStatusCodeLabel = "response_status_code" // DefaultWorkloadIndex - when workload is not specified this value is used. DefaultWorkloadIndex = "default" // DefaultAgentGroup - default agent group. DefaultAgentGroup = "default" )
Variables ¶
This section is empty.
Functions ¶
func Module ¶
Module is a fx module that provides Prometheus registry and invokes registering metrics handler.
func ProvidePrometheusRegistry ¶
func ProvidePrometheusRegistry(unmarshaller config.Unmarshaller) (*prometheus.Registry, error)
ProvidePrometheusRegistry creates a new Prometheus Registry and provides it via Fx. Metrics from the Registry are served on /metrics via the default http server of Fx application.
func RegisterMetricsHandler ¶
func RegisterMetricsHandler(router *mux.Router, pr *prometheus.Registry)
RegisterMetricsHandler registers the metrics handler on the promhttp server.
Types ¶
type MetricsConfig ¶
type MetricsConfig struct { // Pedantic controls whether a pedantic Registerer is used as the prometheus backend. See <https://godoc.org/github.com/prometheus/client_golang/prometheus#NewPedanticRegistry> Pedantic bool `json:"pedantic" default:"false"` // EnableGoCollector controls whether the go collector is registered on startup. See <https://godoc.org/github.com/prometheus/client_golang/prometheus#NewGoCollector> EnableGoCollector bool `json:"enable_go_metrics" default:"false"` // EnableProcessCollector controls whether the process collector is registered on startup. See <https://godoc.org/github.com/prometheus/client_golang/prometheus#NewProcessCollector> EnableProcessCollector bool `json:"enable_process_collector" default:"false"` }
MetricsConfig holds configuration for service metrics. swagger:model
Click to show internal directories.
Click to hide internal directories.