Documentation ¶
Overview ¶
Package metricserver implements a Prometheus metric server for runsc data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SandboxPresenceMetric = prometheus.Metric{ Name: "sandbox_presence", Type: prometheus.TypeGauge, Help: "Boolean metric set to 1 for each known sandbox.", } SandboxRunningMetric = prometheus.Metric{ Name: "sandbox_running", Type: prometheus.TypeGauge, Help: "Boolean metric set to 1 for each running sandbox.", } SandboxMetadataMetric = prometheus.Metric{ Name: "sandbox_metadata", Type: prometheus.TypeGauge, Help: "Key-value pairs about per-sandbox metadata.", } SandboxCapabilitiesMetric = prometheus.Metric{ Name: "sandbox_capabilities", Type: prometheus.TypeGauge, Help: "Linux capabilities added within containers of the sandbox.", } SandboxCapabilitiesMetricLabel = "capability" SpecMetadataMetric = prometheus.Metric{ Name: "spec_metadata", Type: prometheus.TypeGauge, Help: "Key-value pairs about OCI spec metadata.", } SandboxCreationMetric = prometheus.Metric{ Name: "sandbox_creation_time_seconds", Type: prometheus.TypeGauge, Help: "When the sandbox was created, as a unix timestamp in seconds.", } NumRunningSandboxesMetric = prometheus.Metric{ Name: "num_sandboxes_running", Type: prometheus.TypeGauge, Help: "Number of sandboxes running at present.", } NumCannotExportSandboxesMetric = prometheus.Metric{ Name: "num_sandboxes_broken_metrics", Type: prometheus.TypeGauge, Help: "Number of sandboxes from which we cannot export metrics.", } NumTotalSandboxesMetric = prometheus.Metric{ Name: "num_sandboxes_total", Type: prometheus.TypeCounter, Help: "Counter of sandboxes that have ever been started.", } )
Metrics generated by the metrics server itself.
View Source
var Metrics = []*prometheus.Metric{ &SandboxPresenceMetric, &SandboxRunningMetric, &SandboxMetadataMetric, &SandboxCapabilitiesMetric, &SpecMetadataMetric, &SandboxCreationMetric, &NumRunningSandboxesMetric, &NumCannotExportSandboxesMetric, &NumTotalSandboxesMetric, &prometheus.ProcessStartTimeSeconds, }
Metrics is a list of metrics that the metric server generates.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { // Config is the main runsc configuration. Config *config.Config // ExporterPrefix is used as prefix for all metric names following Prometheus exporter convention. ExporterPrefix string // PIDFile, if set, will cause the metric server to write its own PID to this file after binding // to the requested address. The parent directory of this file must already exist. PIDFile string // ExposeProfileEndpoints, if true, exposes /runsc-metrics/profile-cpu and // /runsc-metrics/profile-heap to get profiling data about the metric server. ExposeProfileEndpoints bool // AllowUnknownRoot causes the metric server to keep running regardless of the existence of the // Config's root directory or the metric server's ability to access it. AllowUnknownRoot bool }
Server is the set of options to run a metric server. Initialize this struct and then call Run on it to run the metric server.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package containermetrics returns metrics and labels interesting to export about a container or sandbox.
|
Package containermetrics returns metrics and labels interesting to export about a container or sandbox. |
Click to show internal directories.
Click to hide internal directories.