nri

package
v0.0.0-...-e8b45a3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessInventory

func ProcessInventory(i *integration.Integration) error

func ProcessMetrics

func ProcessMetrics(i *integration.Integration, metricFamilyMap scraper.MetricFamiliesByName, validator Validator) error

Process 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 EntityName

type EntityName struct {
	Metric                string `yaml:"from_metric"`
	Label                 string `yaml:"name_label"`
	DisplayNameLabel      string `yaml:"display_name_label"`
	EntityNrdbLabelName   string `yaml:"entity_nrdb_name"`
	HostnameMetric        string `yaml:"hostname_metric"`
	HostnameLabel         string `yaml:"hostname_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 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.

type Validator

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

Validator groups the rules to validate the service name

func NewValidator

func NewValidator(allowList string, denyList string, allowRegex string) Validator

NewValidator create a new Validator instance

func (Validator) ValidateServiceName

func (v Validator) ValidateServiceName(serviceName string) bool

ValidateServiceName validates the serviceName against allowList, denyList, allowRegex

Jump to

Keyboard shortcuts

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