Skip to main content

Expvar Receiver

Status Available in: contrib Maintainers: @jamesmoessis, @MovieStoreGuy Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

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

Metrics

Metric NameDescriptionUnitTypeAttributes
βœ… process.runtime.memstats.buck_hash_sysBytes of memory in profiling bucket hash tables.ByUpDownCounter
βœ… process.runtime.memstats.freesCumulative count of heap objects freed.{objects}Counter
βœ… process.runtime.memstats.gc_cpu_fractionThe fraction of this program’s available CPU time used by the GC since the program started.1Gauge
βœ… process.runtime.memstats.gc_sysBytes of memory in garbage collection metadata.ByUpDownCounter
βœ… process.runtime.memstats.heap_allocBytes of allocated heap objects.ByUpDownCounter
βœ… process.runtime.memstats.heap_idleBytes in idle (unused) spans.ByUpDownCounter
βœ… process.runtime.memstats.heap_inuseBytes in in-use spans.ByUpDownCounter
βœ… process.runtime.memstats.heap_objectsNumber of allocated heap objects.{objects}UpDownCounter
βœ… process.runtime.memstats.heap_releasedBytes of physical memory returned to the OS.ByUpDownCounter
βœ… process.runtime.memstats.heap_sysBytes of heap memory obtained by the OS.ByUpDownCounter
βœ… process.runtime.memstats.last_pauseThe most recent stop-the-world pause time.nsGauge
❌ process.runtime.memstats.lookupsNumber of pointer lookups performed by the runtime.{lookups}UpDownCounter
βœ… process.runtime.memstats.mallocsCumulative count of heap objects allocated.{objects}Counter
βœ… process.runtime.memstats.mcache_inuseBytes of allocated mcache structures.ByUpDownCounter
βœ… process.runtime.memstats.mcache_sysBytes of memory obtained from the OS for mcache structures.ByUpDownCounter
βœ… process.runtime.memstats.mspan_inuseBytes of allocated mspan structures.ByUpDownCounter
βœ… process.runtime.memstats.mspan_sysBytes of memory obtained from the OS for mspan structures.ByUpDownCounter
βœ… process.runtime.memstats.next_gcThe target heap size of the next GC cycle.ByUpDownCounter
βœ… process.runtime.memstats.num_forced_gcNumber of GC cycles that were forced by the application calling the GC function.ByCounter
βœ… process.runtime.memstats.num_gcNumber of completed GC cycles.ByCounter
βœ… process.runtime.memstats.other_sysBytes of memory in miscellaneous off-heap runtime allocations.ByUpDownCounter
βœ… process.runtime.memstats.pause_totalThe cumulative nanoseconds in GC stop-the-world pauses since the program started.ByCounter
βœ… process.runtime.memstats.stack_inuseBytes in stack spans.ByUpDownCounter
βœ… process.runtime.memstats.stack_sysBytes of stack memory obtained from the OS.ByUpDownCounter
βœ… process.runtime.memstats.sysTotal bytes of memory obtained from the OS.ByUpDownCounter
❌ process.runtime.memstats.total_allocCumulative bytes allocated for heap objects.ByCounter

Configuration

Example Configuration

# The default, minimal configuration
expvar/default:

# More custom configuration
expvar/custom:
  endpoint: "http://localhost:8000/custom/path"
  timeout: 5s
  collection_interval: 30s
  metrics:
    process.runtime.memstats.total_alloc:
      enabled: true
    process.runtime.memstats.mallocs:
      enabled: false

expvar/bad_hostless_endpoint:
  endpoint: "https:///this/aint/a/good/endpoint"

expvar/bad_invalid_url:
  endpoint: "#$%^&*()_"

expvar/bad_schemeless_endpoint:
  endpoint: "localhost:8000/custom/path"

Last generated: 2026-04-13