analytics

package
v6.28.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EndpointResolver endpoints.Resolver = endpoints.ResolverFunc(environmentVariableEndpointResolver)

EndpointResolver is used to override the endpoints that AWS clients use. In particular for reducing networking costs for cross-region traffic, we sometimes use a VPC endpoint rather than going through the public internet and a NAT Gateway

Functions

This section is empty.

Types

type Config

type Config struct {
	// DBName is the name of the ark db. Either specify this or StreamName.
	DBName string
	// Environment is the name of the environment to point to. Default is _DEPLOY_ENV.
	Environment string
	// StreamName is the name of the Firehose to send to. Either specify this or DBName.
	StreamName string
	// Region is the region where this is running. Defaults to _POD_REGION.
	Region string
	// FirehosePutRecordBatchMaxRecords overrides the default value (500) for the maximum number of records to send in a firehose batch.
	FirehosePutRecordBatchMaxRecords int
	// FirehosePutRecordBatchMaxBytes overrides the default value (4000000) for the maximum number of bytes to send in a firehose batch.
	FirehosePutRecordBatchMaxBytes int
	// FirehosePutRecordBatchMaxTime overrides the default value (10 minutes) for the maximum amount of time between writing an event and sending to the firehose.
	FirehosePutRecordBatchMaxTime time.Duration
	// FirehoseAPI defaults to an API object configured with Region, but can be overriden here.
	FirehoseAPI firehoseiface.FirehoseAPI
	// ErrLogger is a logger used to make sure errors from goroutines still get surfaced. Defaults to basic logger.Logger
	ErrLogger logger.KayveeLogger
}

Config configures things related to collecting analytics.

type Logger

type Logger struct {
	logger.KayveeLogger
	// contains filtered or unexported fields
}

Logger writes to Firehose.

func New

func New(c Config) (*Logger, error)

New returns a logger that writes to an analytics ark db. It takes as input the db name and the ark db config file.

func (*Logger) Close

func (al *Logger) Close() error

Close flushes all logs to Firehose.

func (*Logger) Write

func (al *Logger) Write(bs []byte) (int, error)

Write a log.

type RequestErrorClassifier

type RequestErrorClassifier struct{}

RequestErrorClassifier corrects for AWS SDK's lack of automatic retry on "RequestError: connection reset by peer"

func (RequestErrorClassifier) Classify

Classify the error.

Jump to

Keyboard shortcuts

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