windowsperfcountersreceiver

package module
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: Apache-2.0 Imports: 10 Imported by: 8

README

Windows Performance Counters Receiver

This receiver, for Windows only, captures the configured system, application, or custom performance counter data from the Windows registry using the PDH interface. It is based on the Telegraf Windows Performance Counters Input Plugin.

Metrics will be generated with names and labels that match the performance counter path, i.e.

  • Memory\Committed Bytes
  • Processor\% Processor Time, with a datapoint for each Instance label = (_Total, 1, 2, 3, ... )

If one of the specified performance counters cannot be loaded on startup, a warning will be printed, but the application will not fail fast. It is expected that some performance counters may not exist on some systems due to different OS configuration.

Configuration

The collection interval and the list of performance counters to be scraped can be configured:

windowsperfcounters:
  collection_interval: <duration> # default = "1m"
  counters:
    - object: <object name>
      instances: [<instance name>]*
      counters:
        - <counter name>

*Note instances can have several special values depending on the type of counter:

Value Interpretation
Not specified This is the only valid value if the counter has no instances
"*" All instances
"_Total" The "total" instance
"instance1" A single instance
["instance1", "instance2", ...] A set of instances
["_Total", "instance1", "instance2", ...] A set of instances including the "total" instance
Scraping at different frequencies

If you would like to scrape some counters at a different frequency than others, you can configure multiple windowsperfcounters receivers with different collection_interval values. For example:

receivers:
  windowsperfcounters/memory:
    collection_interval: 30s
    counters:
      - object: Memory
        counters:
          - Committed Bytes

  windowsperfcounters/processor:
    collection_interval: 1m
    counters:
      - object: "Processor"
        instances: "*"
        counters:
          - "% Processor Time"
      - object: "Processor"
        instances: [1, 2]
        counters:
          - "% Idle Time"

service:
  pipelines:
    metrics:
      receivers: [windowsperfcounters/memory, windowsperfcounters/processor]
Changing metric format

To report metrics in the desired output format, it's recommended you use this receiver with the metrics transform processor.

e.g. To output the Memory/Committed Bytes counter as a metric with the name system.memory.usage:

receivers:
  windowsperfcounters:
    collection_interval: 30s
    counters:
    - object: Memory
      counters:
        - Committed Bytes

processors:
  metricstransformprocessor:
    transforms:
      - metric_name: "Memory/Committed Bytes"
        action: update
        new_name: system.memory.usage

service:
  pipelines:
    metrics:
      receivers: [windowsperfcounters]
      processors: [metricstransformprocessor]
IIS

TODO

SQL Server

TODO

Documentation

Overview

windowsperfcountersreceiver implements a collector receiver that collects the configured performance counter data at the configured collection interval and converts them into OTLP equivalent metric representations.

This receiver is only compatible with Windows.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() component.ReceiverFactory

NewFactory creates a new factory for windows perf counters receiver.

Types

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`

	PerfCounters []PerfCounterConfig `mapstructure:"perfcounters"`
}

Config defines configuration for WindowsPerfCounters receiver.

func (*Config) Validate added in v0.25.0

func (c *Config) Validate() error

type PerfCounterConfig

type PerfCounterConfig struct {
	Object    string   `mapstructure:"object"`
	Instances []string `mapstructure:"instances"`
	Counters  []string `mapstructure:"counters"`
}

PerfCounterConfig defines configuration for a perf counter object.

Directories

Path Synopsis
internal
pdh

Jump to

Keyboard shortcuts

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