common

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRetries     = 13 // ~7'
	EventDelimiter = '\n'
)
View Source
const (
	OpLogNamespace  = "log_analysis"
	OpLogComponent  = "log_processor"
	OpLogServiceDim = "service"
)

labels for oplog

Variables

View Source
var (
	// Session and clients that can be used by components of the log processor
	Session      *session.Session
	LambdaClient lambdaiface.LambdaAPI
	S3Uploader   s3manageriface.UploaderAPI
	SqsClient    sqsiface.SQSAPI
	SnsClient    snsiface.SNSAPI

	Config EnvConfig

	SQSWaitTime int64 // set by env
)
View Source
var (
	OpLogManager = oplog.NewManager(OpLogNamespace, OpLogComponent)

	OpLogLambdaServiceDim    = zap.String(OpLogServiceDim, "lambda")
	OpLogS3ServiceDim        = zap.String(OpLogServiceDim, "s3")
	OpLogSNSServiceDim       = zap.String(OpLogServiceDim, "sns")
	OpLogProcessorServiceDim = zap.String(OpLogServiceDim, "processor")
	OpLogGlueServiceDim      = zap.String(OpLogServiceDim, "glue")
)
View Source
var (
	BytesProcessedLogger = metrics.MustStaticLogger([]metrics.DimensionSet{
		{
			"LogType",
		},
	}, []metrics.Metric{
		{
			Name: "BytesProcessed",
			Unit: metrics.UnitBytes,
		},
		{
			Name: "EventsProcessed",
			Unit: metrics.UnitCount,
		},
		{
			Name: "CombinedLatency",
			Unit: metrics.UnitMilliseconds,
		},
	})
)

Functions

func BuildJSON added in v1.7.0

func BuildJSON() jsoniter.API

BuildJSON returns a jsoniter.API instance that is configured to be used for decoding/encoding JSON log events.

func Setup added in v1.2.0

func Setup()

Types

type DataStream

type DataStream struct {
	Reader      io.Reader
	Source      *models.SourceIntegration
	S3ObjectKey string
	S3Bucket    string
	ContentType string
}

DataStream represents a data stream that read by the processor

type EnvConfig added in v1.2.0

type EnvConfig struct {
	AwsLambdaFunctionMemorySize int    `required:"true" split_words:"true"`
	ProcessedDataBucket         string `required:"true" split_words:"true"`
	SqsQueueURL                 string `required:"true" split_words:"true"`
	SqsDelaySec                 int64  `required:"true" split_words:"true"`
	SnsTopicARN                 string `required:"true" split_words:"true"`
}

Jump to

Keyboard shortcuts

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