newrelic

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogMessage

type LogMessage struct {
	// Milliseconds or seconds since epoch
	Timestamp  int64                  `json:"timestamp,omitempty"`
	Attributes map[string]interface{} `json:"attributes,omitempty"`
	Message    string                 `json:"message,omitempty"`
}

LogMessage represents a single log entry that will be marshalled in the format expected by the New Relic Log API

func LogMessageFromEntry

func LogMessageFromEntry(entry *entry.Entry, messageField entry.Field) *LogMessage

LogMessageFromEntry creates a new LogMessage from a given entry.Entry

type LogPayload

type LogPayload []struct {
	Common LogPayloadCommon `json:"common"`
	Logs   []*LogMessage    `json:"logs"`
}

LogPayload represents a single payload delivered to the New Relic Log API

func LogPayloadFromEntries

func LogPayloadFromEntries(entries []*entry.Entry, messageField entry.Field) LogPayload

LogPayloadFromEntries creates a new []*LogPayload from an array of entries

type LogPayloadCommon

type LogPayloadCommon struct {
	// Milliseconds or seconds since epoch
	Timestamp int `json:"timestamp,omitempty"`

	Attributes map[string]interface{} `json:"attributes"`
}

LogPayloadCommon represents the common attributes in a payload segment

type NewRelicOutput

type NewRelicOutput struct {
	helper.OutputOperator
	// contains filtered or unexported fields
}

NewRelicOutput is an operator that sends entries to the New Relic Logs platform

func (*NewRelicOutput) Process

func (nro *NewRelicOutput) Process(ctx context.Context, entry *entry.Entry) error

Process adds an entry to the output's buffer

func (*NewRelicOutput) Start

func (nro *NewRelicOutput) Start() error

Start tests the connection to New Relic and begins flushing entries

func (*NewRelicOutput) Stop

func (nro *NewRelicOutput) Stop() error

Stop tells the NewRelicOutput to stop gracefully

type NewRelicOutputConfig

type NewRelicOutputConfig struct {
	helper.OutputConfig `yaml:",inline"`
	BufferConfig        buffer.Config  `json:"buffer" yaml:"buffer"`
	FlusherConfig       flusher.Config `json:"flusher" yaml:"flusher"`

	APIKey       string          `json:"api_key,omitempty"       yaml:"api_key,omitempty"`
	BaseURI      string          `json:"base_uri,omitempty"      yaml:"base_uri,omitempty"`
	LicenseKey   string          `json:"license_key,omitempty"   yaml:"license_key,omitempty"`
	Timeout      helper.Duration `json:"timeout,omitempty"       yaml:"timeout,omitempty"`
	MessageField entry.Field     `json:"message_field,omitempty" yaml:"message_field,omitempty"`
}

NewRelicOutputConfig is the configuration of a NewRelicOutput operator

func NewNewRelicOutputConfig

func NewNewRelicOutputConfig(operatorID string) *NewRelicOutputConfig

NewNewRelicOutputConfig creates a new relic output config with default values

func (NewRelicOutputConfig) Build

Build will build a new NewRelicOutput

Jump to

Keyboard shortcuts

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