common

package
v0.0.0-...-f1e0df7 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserAgentMetadata

func AddUserAgentMetadata(handler, parser string)

AddUserAgentMetadata adds additional metadata to the user agent string

func ConstructParser

func ConstructParser(parserType string) (parsers.LineParser, error)

ConstructParser accepts a parser name and attempts to build the parser, pulling additional environment variables as needed

func ConvertTypes

func ConvertTypes(input map[string]interface{}) map[string]interface{}

ConvertTypes will convert strings into integer and floats if applicable

func GetFilterFields

func GetFilterFields() []string

GetFilterFields returns a list of fields to be deleted from an event before it is sent to Honeycomb If FILTER_FIELDS is not set, returns an empty list.

func GetMatchString

func GetMatchString() string

GetMatchString returns a string from the environment variable HONEYCOMB_EVENT_MATCH_STRINGS to use to determine HC events from an unfiltered stream

func GetSampleRate

func GetSampleRate() uint

GetSampleRate returns the sample rate the configured sample rate

func InitHoneycombFromEnvVars

func InitHoneycombFromEnvVars() error

InitHoneycombFromEnvVars will attempt to call libhoney.Init based on values passed to the lambda through env vars. The caller is responsible for calling libhoney.Close afterward. Will return an err if insufficient ENV vars were specified.

func WriteErrorEvent

func WriteErrorEvent(err error, errorType string, fields map[string]interface{})

WriteErrorEvent writes the error and optional fields to the Error Dataset, if an error dataset was specified

Types

type Payload

type Payload struct {
	Time       time.Time
	SampleRate uint
	Dataset    string
	Data       interface{}
}

func ExtractPayload

func ExtractPayload(data map[string]interface{}) (*Payload, error)

ExtractPayload takes the string input of a "log" and parses out some key fields.

Jump to

Keyboard shortcuts

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