httpcheckreceiver

package module
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 9

README

HTTP Check Receiver

Status
Stability development
Supported pipeline types metrics
Distributions contrib

The HTTP Check Receiver can be used for synthethic checks against HTTP endpoints. This receiver will make a request to the specified endpoint using the configured method. This scraper generates a metric with a label for each HTTP response status class with a value of 1 if the status code matches the class. For example, the following metrics will be generated if the endpoint returned a 200:

httpcheck.status{http.status_class:1xx, http.status_code:200,...} = 0
httpcheck.status{http.status_class:2xx, http.status_code:200,...} = 1
httpcheck.status{http.status_class:3xx, http.status_code:200,...} = 0
httpcheck.status{http.status_class:4xx, http.status_code:200,...} = 0
httpcheck.status{http.status_class:5xx, http.status_code:200,...} = 0

Configuration

The following configuration settings are required:

  • endpoint: The URL of the endpoint to be monitored.

The following configuration settings are optional:

  • method (default: GET): The method used to call the endpoint.
  • collection_interval (default = 60s): This receiver collects metrics on an interval. Valid time units are ns, us (or µs), ms, s, m, h.
Example Configuration
receivers:
  httpcheck:
    endpoint: http://endpoint:80
    method: GET
    collection_interval: 10s

Metrics

Details about the metrics produced by this receiver can be found in documentation.md

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new receiver factory

Types

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
	confighttp.HTTPClientSettings           `mapstructure:",squash"`
	metadata.MetricsBuilderConfig           `mapstructure:",squash"`
	Method                                  string `mapstructure:"method"`
}

Config defines the configuration for the various elements of the receiver agent.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the configuration by checking for missing or invalid fields

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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