azure_exporter

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Timespan:              "PT1M",
	MetricNameTemplate:    "azure_{type}_{metric}_{aggregation}_{unit}",
	MetricHelpTemplate:    "Azure metric {metric} for {type} with aggregation {aggregation} as {unit}",
	IncludedResourceTags:  []string{"owner"},
	AzureCloudEnvironment: "azurecloud",

	ValidateDimensions: false,
}

DefaultConfig holds the default settings for the azure_exporter integration.

Functions

This section is empty.

Types

type Config

type Config struct {
	Subscriptions            []string `yaml:"subscriptions"`               // Required
	ResourceGraphQueryFilter string   `yaml:"resource_graph_query_filter"` // Optional
	Regions                  []string `yaml:"regions"`                     // Optional

	// Valid values can be derived from https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported
	// Required: Root level names ex. Microsoft.DataShare/accounts
	ResourceType string `yaml:"resource_type"`
	// Required: Metric in the table for a ResourceType
	Metrics []string `yaml:"metrics"`
	// Optional: If not provided Aggregation Type is used for the Metric
	// Valid values are minimum, maximum, average, total, and count
	MetricAggregations []string `yaml:"metric_aggregations"`

	// All fields below are optional
	// Must be an ISO8601 Duration - defaults to PT1M if not specified
	Timespan             string   `yaml:"timespan"`
	IncludedDimensions   []string `yaml:"included_dimensions"`
	IncludedResourceTags []string `yaml:"included_resource_tags"`

	// MetricNamespace is used for ResourceTypes which have multiple levels of metrics
	// As an example the ResourceType Microsoft.Storage/storageAccounts has metrics for
	//  Microsoft.Storage/storageAccounts (generic metrics which apply to all storage accounts)
	//	Microsoft.Storage/storageAccounts/blobServices (generic metrics + metrics which only apply to blob stores)
	// 	Microsoft.Storage/storageAccounts/fileServices (generic metrics + metrics which only apply to file stores)
	//	Microsoft.Storage/storageAccounts/queueServices (generic metrics + metrics which only apply to queue stores)
	//	Microsoft.Storage/storageAccounts/tableServices (generic metrics + metrics which only apply to table stores)
	// If you want blob store metrics you will need to set
	//  ResourceType = Microsoft.Storage/storageAccounts
	//	MetricNamespace = Microsoft.Storage/storageAccounts/blobServices
	MetricNamespace string `yaml:"metric_namespace"`

	MetricNameTemplate string `yaml:"metric_name_template"`
	MetricHelpTemplate string `yaml:"metric_help_template"`
	ValidateDimensions bool   `yaml:"validate_dimensions"`

	AzureCloudEnvironment string `yaml:"azure_cloud_environment"`
}

func MergeConfigWithQueryParams

func MergeConfigWithQueryParams(cfg Config, params url.Values) (Config, error)

MergeConfigWithQueryParams will map values from params which where the key matches a yaml tag of the Config struct

func (*Config) InstanceKey

func (c *Config) InstanceKey(_ string) (string, error)

func (*Config) Name

func (c *Config) Name() string

func (*Config) NewIntegration

func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)

func (*Config) ToScrapeSettings

func (c *Config) ToScrapeSettings() (*metrics.RequestMetricSettings, error)

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler for Config.

func (*Config) Validate

func (c *Config) Validate() error

type Exporter

type Exporter struct {
	ConcurrencyConfig azure_config.Opts
	// contains filtered or unexported fields
}

func (Exporter) MetricsHandler

func (e Exporter) MetricsHandler() (http.Handler, error)

func (Exporter) Run

func (e Exporter) Run(ctx context.Context) error

func (Exporter) ScrapeConfigs

func (e Exporter) ScrapeConfigs() []config.ScrapeConfig

Jump to

Keyboard shortcuts

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