nri

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessMetrics

func ProcessMetrics(i *integration.Integration, metricFamilyMap scraper.MetricFamiliesByName, matcher matcher.Matcher, hostname string) error

ProcessMetrics creates entities and add metrics from the MetricFamiliesByName according to rules

Types

type Attribute

type Attribute struct {
	Label            string `yaml:"provider_name"`
	NrdbLabelName    string `yaml:"nrdb_name"`
	IsEntityMetadata bool   `yaml:"entity_metadata"` // when true this attribute will be use as metadata.
}

Attribute describe metrics attributes to be add.

type Config added in v0.0.3

type Config struct {
	Matcher             matcher.Matcher
	ExporterBindAddress string
	ExporterBindPort    string
	ScrapeInterval      time.Duration
	HeartBeatPeriod     time.Duration
}

Config holds the integration configuration

func NewConfig added in v0.0.3

func NewConfig(filename string) (*Config, error)

NewConfig reads the configuration from yml file

type EntityName

type EntityName struct {
	Metric                string `yaml:"from_metric"`
	Label                 string `yaml:"name_label"`
	DisplayNameLabel      string `yaml:"display_name_label"`
	HostnameNrdbLabelName string `yaml:"hostname_nrdb_name"`
}

EntityName indicates which metrics labels use to form the unique entity name and displayName for windows services the entity name is win_service:hostname:serviceName.

type EntityRules

type EntityRules struct {
	EntityType string        `yaml:"type"`
	EntityName EntityName    `yaml:"name"`
	Metrics    []MetricRules `yaml:"metrics"`
}

EntityRules represents rules to convert prometheus metrics into NewRelic entities.

type MetricRules

type MetricRules struct {
	ProviderName string      `yaml:"provider_name"`
	MetricType   string      `yaml:"type"`
	NrdbName     string      `yaml:"nrdb_name"`
	EnumMetric   bool        `yaml:"enum_metric"`
	InfoMetric   bool        `yaml:"info_metric"`
	Attributes   []Attribute `yaml:"attributes"`
}

MetricRules describe the metrics that compose the entity.

prometheus enums metrics are generally send using following style:

windows_service_start_mode{name="wersvc",start_mode="auto"} 0
windows_service_start_mode{name="wersvc",start_mode="disabled"} 0
windows_service_start_mode{name="wersvc",start_mode="manual"} 1

using EnumMetric=true will only send the metric with value 1 with the corresponding attribute

for promethus *_info metrics no metric will be send, just metadata.

Jump to

Keyboard shortcuts

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