azuremonitorreceiver

package module
v0.86.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 25 Imported by: 5

README

Azure Monitor Receiver

Status
Stability development: metrics
Distributions contrib
Issues Open issues Closed issues
Code Owners @altuner, @codeboten

This receiver scrapes Azure Monitor API for resources metrics.

Configuration

The following settings are required:

  • subscription_id
  • tenant_id
  • client_id
  • client_secret

The following settings are optional:

  • resource_groups (default = none): Filter metrics for specific resource groups, not setting a value will scrape metrics for all resources in the subscription.
  • services (default = none): Filter metrics for specific services, not setting a value will scrape metrics for all services integrated with Azure Monitor.
  • cache_resources (default = 86400): List of resources will be cached for the provided amount of time in seconds.
  • cache_resources_definitions (default = 86400): List of metrics definitions will be cached for the provided amount of time in seconds.
  • maximum_number_of_metrics_in_a_call (default = 20): Maximum number of metrics to fetch in per API call, current limit in Azure is 20 (as of 03/27/2023).
  • initial_delay (default = 1s): defines how long this receiver waits before starting.
Example Configuration
receivers:
  azuremonitor:
    subscription_id: "${subscription_id}"
    tenant_id: "${tenant_id}"
    client_id: "${client_id}"
    client_secret: "${env:CLIENT_SECRET}"
    resource_groups:
      - "${resource_group1}"
      - "${resource_group2}"
    services:
      - "${service1}"
      - "${service2}"
    collection_interval: 60s
    initial_delay: 1s

Metrics

Details about the metrics scraped by this receiver can be found in Supported metrics with Azure Monitor. This receiver adds the prefix "azure_" to all scraped metrics.

Documentation

Overview

Package azuremonitorreceiver scrapes Azure Monitor API for available metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a new receiver factory

Types

type ArmClient

type ArmClient interface {
	NewListPager(options *armresources.ClientListOptions) *runtime.Pager[armresources.ClientListResponse]
}

type Config

type Config struct {
	scraperhelper.ScraperControllerSettings `mapstructure:",squash"`
	MetricsBuilderConfig                    metadata.MetricsBuilderConfig `mapstructure:",squash"`
	SubscriptionID                          string                        `mapstructure:"subscription_id"`
	TenantID                                string                        `mapstructure:"tenant_id"`
	ClientID                                string                        `mapstructure:"client_id"`
	ClientSecret                            string                        `mapstructure:"client_secret"`
	ResourceGroups                          []string                      `mapstructure:"resource_groups"`
	Services                                []string                      `mapstructure:"services"`
	CacheResources                          float64                       `mapstructure:"cache_resources"`
	CacheResourcesDefinitions               float64                       `mapstructure:"cache_resources_definitions"`
	MaximumNumberOfMetricsInACall           int                           `mapstructure:"maximum_number_of_metrics_in_a_call"`
	AppendTagsAsAttributes                  bool                          `mapstructure:"append_tags_as_attributes"`
}

Config defines the configuration for the various elements of the receiver agent.

func (Config) Validate

func (c Config) Validate() (err error)

Validate validates the configuration by checking for missing or invalid fields

type MetricsDefinitionsClientInterface

type MetricsDefinitionsClientInterface interface {
	NewListPager(resourceURI string, options *armmonitor.MetricDefinitionsClientListOptions) *runtime.Pager[armmonitor.MetricDefinitionsClientListResponse]
}

type MetricsValuesClient

type MetricsValuesClient interface {
	List(ctx context.Context, resourceURI string, options *armmonitor.MetricsClientListOptions) (
		armmonitor.MetricsClientListResponse, error,
	)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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