healthcheckextension

package module
v0.110.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 21

README

Health Check

⚠️⚠️⚠️ Warning ⚠️⚠️⚠️

The check_collector_pipeline feature of this extension is not working as expected. It is recommended to not use the feature. The work to add a new version of the healthcheck extension that relies on individual component status is in progress. To avoid breaking backwards compatibility, the configuration will not be changed until the new extension is available as a replacement for this one. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/11780 for more details.

Status
Stability beta
Distributions core, contrib
Issues Open issues Closed issues
Code Owners @jpkrohling

Health Check extension enables an HTTP url that can be probed to check the status of the OpenTelemetry Collector. This extension can be used as a liveness and/or readiness probe on Kubernetes.

The following settings are required:

  • endpoint (default = localhost:13133): Address to publish the health check status. For full list of ServerConfig refer here. You can temporarily disable the component.UseLocalHostAsDefaultHost feature gate to change this to 0.0.0.0:13133. This feature gate will be removed in a future release.
  • path (default = "/"): Specifies the path to be configured for the health check server.
  • response_body (default = ""): Specifies a static body that overrides the default response returned by the health check service.

Example:

extensions:
  health_check:
  health_check/1:
    endpoint: "localhost:13"
    tls:
      ca_file: "/path/to/ca.crt"
      cert_file: "/path/to/cert.crt"
      key_file: "/path/to/key.key"
    path: "/health/status"

The full list of settings exposed for this exporter is documented here with detailed sample configurations here.

Documentation

Overview

Package healthcheckextension implements an extension that enables an HTTP endpoint that can be used to check the overall health and status of the service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() extension.Factory

NewFactory creates a factory for HealthCheck extension.

Types

type Config

type Config struct {
	confighttp.ServerConfig `mapstructure:",squash"`

	// Path represents the path the health check service will serve.
	// The default path is "/".
	Path string `mapstructure:"path"`

	// ResponseBody represents the body of the response returned by the health check service.
	// This overrides the default response that it would return.
	ResponseBody *ResponseBodySettings `mapstructure:"response_body"`

	// CheckCollectorPipeline contains the list of settings of collector pipeline health check
	CheckCollectorPipeline checkCollectorPipelineSettings `mapstructure:"check_collector_pipeline"`
}

Config has the configuration for the extension enabling the health check extension, used to report the health status of the service.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the extension configuration is valid

type ResponseBodySettings added in v0.74.0

type ResponseBodySettings struct {
	// Healthy represents the body of the response returned when the collector is healthy.
	// The default value is ""
	Healthy string `mapstructure:"healthy"`

	// Unhealthy represents the body of the response returned when the collector is unhealthy.
	// The default value is ""
	Unhealthy string `mapstructure:"unhealthy"`
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL