Documentation ¶
Overview ¶
Package probe implements HTTP probes: the K8s readiness and liveliness probe handlers + Prometheus format.
Index ¶
Constants ¶
View Source
const ( // DefaultHealthPath default Prometheus health metrics URL DefaultHealthPath = "/health" // Namespace namespace to use for Prometheus health metrics Namespace = "" // Subsystem subsystem to use for Prometheus health metrics Subsystem = "" // ServiceLabel label for service field ServiceLabel = "service" // DependencyLabel label for dependency field DependencyLabel = "dependency" // BuildVersionLabel label for build version field BuildVersionLabel = "build_version" // BuildDateLabel label for build date field BuildDateLabel = "build_date" // ServiceHealthName name of service health metric ServiceHealthName = "service_health" // ServiceHealthHelp help text for service health metric // Adapt Ligato status code for now. // TODO: Consolidate with that from the "Common Container Telemetry" proposal. // ServiceHealthHelp string = "The health of the ServiceLabel 0 = INIT, 1 = UP, 2 = DOWN, 3 = OUTAGE" ServiceHealthHelp = "The health of the ServiceLabel 0 = INIT, 1 = OK, 2 = ERROR" // DependencyHealthName name of dependency health metric DependencyHealthName = "service_dependency_health" // DependencyHealthHelp help text for dependency health metric // Adapt Ligato status code for now. // TODO: Consolidate with that from the "Common Container Telemetry" proposal. // DependencyHealthHelp string = "The health of the DependencyLabel 0 = INIT, 1 = UP, 2 = DOWN, 3 = OUTAGE" DependencyHealthHelp = "The health of the DependencyLabel 0 = INIT, 1 = OK, 2 = ERROR" // ServiceInfoName name of service info metric ServiceInfoName = "service_info" // ServiceInfoHelp help text for service info metric ServiceInfoHelp = "Build info for the service. Value is always 1, build info is in the tags." )
Variables ¶
View Source
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of Plugin.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct { infra.PluginDeps ServiceLabel servicelabel.ReaderAPI StatusCheck statuscheck.StatusReader // inject HTTP rest.HTTPHandlers // inject Prometheus prom.API // inject }
Deps lists dependencies of REST plugin.
type ExposedStatus ¶ added in v1.7.0
type ExposedStatus struct { status.AgentStatus PluginStatus map[string]*status.PluginStatus // NonFatalPlugins is a configured list of plugins whose // errors are not reflected in overall state. NonFatalPlugins []string }
ExposedStatus groups the information exposed via readiness and liveness probe
type Option ¶ added in v1.5.0
type Option func(*Plugin)
Option is a function that can be used in NewPlugin to customize Plugin.
func WithNonFatalPlugins ¶ added in v1.7.0
WithNonFatalPlugins defines plugins whose errors are effectively ignored in agent's overall status.
type Plugin ¶
type Plugin struct { Deps // NonFatalPlugins is a list of plugin names. Error reported by a plugin // from the list is not propagated into overall agent status. NonFatalPlugins []string }
Plugin struct holds all plugin-related data.
Click to show internal directories.
Click to hide internal directories.