Skip to content

Push custom New Relic Insight datasource in golang

Notifications You must be signed in to change notification settings

reddotpay/nrpush

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nrpush

Push custom New Relic Insight datasource in golang

Installation

import "github.com/reddotpay/nrpush"

Usage

const Endpoint = "https://insights-collector.newrelic.com/v1/accounts/{:accountID}/events"

Endpoint defines the New Relic HTTP URL where the payload will be sent

var (
	// Verbose indicates if details of the HTTP request will be displayed
	Verbose = false
)

type NRPush

type NRPush struct {
	Endpoint  string
	InsertKey string
	EventType string
}

NRPush represents an NewRelic Push data

func New

func New(insertKey, accountID, eventType string) NRPush

New creates sets a new NRPush configuration. accountID numeric. Can be found as part of the URL endpoint in Insigts dashboard

func (NRPush) Push

func (n NRPush) Push(ctx context.Context, data interface{}) (string, error)

Push inserts a new custom data and return the UUID when successful

func (NRPush) PushBatch

func (n NRPush) PushBatch(ctx context.Context, data []interface{}) (string, error)

PushBatch inserts a batch of new custom data and return the UUID when successful

About

Push custom New Relic Insight datasource in golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages