nr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvNrApiKey = "NEW_RELIC_API_KEY"

	NR_DATA_PROVIDER = "kentik"
	NR_USER_AGENT    = "kentik-ktranslate/0.1.0"

	REGION_EU         = "eu"
	REGION_US         = "us"
	REGION_GOV        = "gov"
	REGION_US_STAGING = "us_stage"
)

Variables

View Source
var (
	NrUrl        = "https://insights-collector.newrelic.com/v1/accounts/%s/events"
	NrMetricsUrl = "https://metric-api.newrelic.com/metric/v1"
	NrLogUrl     = "https://log-api.newrelic.com/log/v1"
)
View Source
var (
	NrAccount    = flag.String("nr_account_id", kt.LookupEnvString("NR_ACCOUNT_ID", ""), "If set, sends flow to New Relic")
	EstimateSize = flag.Bool("nr_estimate_only", false, "If true, record size of inputs to NR but don't actually send anything")
	NrRegion     = flag.String("nr_region", kt.LookupEnvString("NR_REGION", ""), "NR Region to use. US|EU")
	NrCheckJson  = flag.Bool("nr_check_json", false, "Verify body is valid json before sending on")
)

Functions

This section is empty.

Types

type NRMetric

type NRMetric struct {
	DeliveryErr     go_metrics.Meter
	DeliveryWin     go_metrics.Meter
	DeliveryMetrics go_metrics.Meter
	DeliveryLogs    go_metrics.Meter
}

type NRResponce

type NRResponce struct {
	Success   bool   `json:"success"`
	Uuid      string `json:"uuid"`
	RequestId string `json:"requestId"`
}

type NRSink

type NRSink struct {
	logger.ContextL
	NRAccount   string
	NRApiKey    string
	NRUrl       string
	NRUrlEvent  string
	NRUrlMetric string
	NRUrlLog    string
	// contains filtered or unexported fields
}

func NewSink

func NewSink(log logger.Underlying, registry go_metrics.Registry, tooBig chan int, logTee chan string) (*NRSink, error)

func (*NRSink) Close

func (s *NRSink) Close()

func (*NRSink) HttpInfo

func (s *NRSink) HttpInfo() map[string]float64

func (*NRSink) Init

func (s *NRSink) Init(ctx context.Context, format formats.Format, compression kt.Compression, fmtr formats.Formatter) error

func (*NRSink) Send

func (s *NRSink) Send(ctx context.Context, payload *kt.Output)

Jump to

Keyboard shortcuts

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