expvarreceiver

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 6

README

Expvar Receiver

Status
Stability alpha: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @jamesmoessis, @MovieStoreGuy

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
  • initial_delay (default = 1s): defines how long this receiver waits before starting.
  • 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.ControllerConfig `mapstructure:",squash"`
	confighttp.ClientConfig        `mapstructure:",squash"`
	metadata.MetricsBuilderConfig  `mapstructure:",squash"`
}

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