scraper

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package scraper ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *Config) error

Run runs the scraper

func RunWithEmitters

func RunWithEmitters(cfg *Config, emitters []integration.Emitter) error

RunWithEmitters runs the scraper with preselected emitters.

Types

type Config

type Config struct {
	ConfigFile                        string
	MetricAPIURL                      string                       `mapstructure:"metric_api_url"`
	LicenseKey                        LicenseKey                   `mapstructure:"license_key"`
	ClusterName                       string                       `mapstructure:"cluster_name"`
	Debug                             bool                         `mapstructure:"debug"`
	Verbose                           bool                         `mapstructure:"verbose"`
	Emitters                          []string                     `mapstructure:"emitters"`
	ScrapeEnabledLabel                string                       `mapstructure:"scrape_enabled_label"`
	RequireScrapeEnabledLabelForNodes bool                         `mapstructure:"require_scrape_enabled_label_for_nodes"`
	ScrapeTimeout                     time.Duration                `mapstructure:"scrape_timeout"`
	ScrapeDuration                    string                       `mapstructure:"scrape_duration"`
	EmitterHarvestPeriod              string                       `mapstructure:"emitter_harvest_period"`
	TargetConfigs                     []endpoints.TargetConfig     `mapstructure:"targets"`
	AutoDecorate                      bool                         `mapstructure:"auto_decorate" default:"false"`
	CaFile                            string                       `mapstructure:"ca_file"`
	BearerTokenFile                   string                       `mapstructure:"bearer_token_file"`
	InsecureSkipVerify                bool                         `mapstructure:"insecure_skip_verify" default:"false"`
	ProcessingRules                   []integration.ProcessingRule `mapstructure:"transformations"`
	Percentiles                       []float64                    `mapstructure:"percentiles"`
	DecorateFile                      bool
	EmitterProxy                      string `mapstructure:"emitter_proxy"`
	// Parsed version of `EmitterProxy`
	EmitterProxyURL                              *url.URL
	EmitterCAFile                                string        `mapstructure:"emitter_ca_file"`
	EmitterInsecureSkipVerify                    bool          `mapstructure:"emitter_insecure_skip_verify" default:"false"`
	TelemetryEmitterDeltaExpirationAge           time.Duration `mapstructure:"telemetry_emitter_delta_expiration_age"`
	TelemetryEmitterDeltaExpirationCheckInterval time.Duration `mapstructure:"telemetry_emitter_delta_expiration_check_interval"`
}

Config is the config struct for the scraper.

type LicenseKey

type LicenseKey string

LicenseKey is a New Relic license key that will be masked when printed using standard formatters

func (LicenseKey) GoString

func (l LicenseKey) GoString() string

GoString ensures that the LicenseKey will be masked in functions like fmt.Printf("%#v", licenseKey)

func (LicenseKey) String

func (l LicenseKey) String() string

String ensures that the LicenseKey will be masked in functions like fmt.Println(licenseKey)

Jump to

Keyboard shortcuts

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