nodeexporter

package module
v0.0.0-...-074a6a7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

README

This repository is the repackaging of node_exporter as an Opentelemetry Collector Receiver.

(Despite the name, it's a receiver)

Opentelemetry Collector already has a component to scrape node metrics. First of all, I recommend to check hostmetrics.

node_exporter receiver is intended to be used when you want to reuse existing dashboards and alerting rules built for Prometheus node_exporter (or just need one of the collectors).

Unfortunately it's not easy to reuse node_exporter because the usage of global variables and flag parsing.

Grafana Alloy had a similar problem, and they created a fork: https://github.com/prometheus/node_exporter/pull/2812

Here, I use different approach. The collector directory is vanilla node_exporter, only the import path of the kingpin library is replaced.

That can make it easer to keep up to date with the original node_exporter.

Can be configured like the original node exporter using the flags field in configuration.

Example:

receivers:
  nodeexporter:
    interval: 10s
    flags:
      collector.cpu: "false"
  
...

service:
  pipelines:
    metrics:
      receivers: [nodeexporter]
      exporters: [debug]

This is just a repackage. Kudos for the original contributors (can be found in the current Git history).

Documentation

Overview

This file is the refactored version of https://github.com/open-telemetry/opentelemetry-go-contrib/blob/bridges/prometheus/v0.63.0/bridges/prometheus/producer.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for tailtracer receiver.

Types

type Config

type Config struct {
	Interval string            `mapstructure:"interval"`
	Flags    map[string]string `mapstructure:"flags"`
}

type NodeExporterReceiver

type NodeExporterReceiver struct {
	// contains filtered or unexported fields
}

func (*NodeExporterReceiver) Shutdown

func (s *NodeExporterReceiver) Shutdown(ctx context.Context) error

func (*NodeExporterReceiver) Start

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option sets producer option values.

func WithGatherer

func WithGatherer(gatherer prometheus.Gatherer) Option

WithGatherer configures which prometheus Gatherer the Bridge will gather from. If no registerer is used the prometheus DefaultGatherer is used.

func WithScope

func WithScope(scope string) Option

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewMetricProducer

func NewMetricProducer(opts ...Option) *Producer

NewMetricProducer returns a metric.Producer that fetches metrics from Prometheus. This can be used to allow Prometheus instrumentation to be added to an OpenTelemetry export pipeline.

func (*Producer) Produce

func (p *Producer) Produce(context.Context) (pmetric.Metrics, error)

Directories

Path Synopsis
Package collector includes all individual collectors to gather and export system metrics.
Package collector includes all individual collectors to gather and export system metrics.

Jump to

Keyboard shortcuts

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