newrelic

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNewRelicAdapter

func NewNewRelicAdapter(route *router.Route) (router.LogAdapter, error)

NewNewRelicAdapter is a new logspout Adapter

Types

type Adapter

type Adapter struct {
	Endpoint        string
	Hostname        string
	Key             string
	AuthHeader      string
	Verbose         bool
	FlushInterval   time.Duration
	MaxBufferSize   uint64
	MaxLineLength   uint64
	MaxRequestRetry uint64
	Log             *log.Logger
	Queue           chan Line
	HTTPClient      *http.Client
}

Adapter is an adapter for streaming JSON from logspout to NR collector.

func (*Adapter) Stream

func (adapter *Adapter) Stream(logstream chan *router.Message)

Stream logs

type Attributes

type Attributes struct {
	Plugin     Plugin            `json:"plugin"`
	GlobalTags map[string]string `json:"global_tags,omitempty"`
}

Attributes struct

type Body

type Body struct {
	Logs   []Message `json:"logs"`
	Common Common    `json:"common"`
}

Body struct

type Common

type Common struct {
	Attributes Attributes `json:"attributes"`
}

Common struct

type ContainerInfo

type ContainerInfo struct {
	Name   string            `json:"name"`
	ID     string            `json:"id"`
	PID    int               `json:"pid,omitempty"`
	Image  string            `json:"image"`
	Labels map[string]string `json:"labels"`
}

ContainerInfo contains the container attributes

type Line

type Line struct {
	Log     []byte `json:"_"`
	Retried uint64 `json:"-"`
}

Line contains the message and number of post retries

type Message

type Message struct {
	Timestamp int64         `json:"timestamp"`
	Message   string        `json:"message"`
	Container ContainerInfo `json:"container"`
	Severity  string        `json:"severity"`
	Hostname  string        `json:"hostname"`
}

Message is the actual Log structure

type Plugin

type Plugin struct {
	Type string `json:"type"`
}

Plugin struct

Jump to

Keyboard shortcuts

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