expvarreceiver

package module
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 6

README

Expvar Receiver

Status
Stability alpha
Supported pipeline types metrics
Distributions contrib

An Expvar Receiver scrapes metrics from expvar, which exposes data in JSON format from an HTTP endpoint. The metrics are extracted from the expvar variable memstats, which exposes various information about the Go runtime.

Configuration

Default

By default, without any configuration, a request will be sent to http://localhost:8000/debug/vars every 60 seconds. The default configuration is achieved by the following:

receivers:
  expvar:
Customising

The following can be configured:

  • Configure the HTTP client for scraping the expvar variables. The full set of configuration options for the client can be found in the core repo's confighttp.
    • defaults:
      • endpoint = http://localhost:8000/debug/vars
      • timeout = 3s
  • collection_interval - Configure how often the metrics are scraped.
    • default: 1m
  • metrics - Enable or disable metrics by name.
Example configuration
receivers:
  expvar:
    endpoint: "http://localhost:8000/custom/path"
    timeout: 1s
    collection_interval: 30s
    metrics:
      process.runtime.memstats.total_alloc:
        enabled: true
      process.runtime.memstats.mallocs:
        enabled: false

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

Types

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
	confighttp.HTTPClientSettings           `mapstructure:",squash"`
	MetricsConfig                           metadata.MetricsSettings `mapstructure:"metrics"`
}

func (*Config) Validate

func (c *Config) Validate() error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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