internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudwatchLogEvent

type CloudwatchLogEvent struct {
	// ID is a unique id for each log event.
	ID string `json:"id"`

	Timestamp int64  `json:"timestamp"`
	Message   string `json:"message"`
}

CloudwatchLogEvent is a single CloudWatch logging event.

type CloudwatchLogsRecord

type CloudwatchLogsRecord struct {
	// Owner is the AWS Account ID of the originating log data
	Owner string `json:"owner"`

	// LogGroup is the log group name of the originating log data
	LogGroup string `json:"logGroup"`

	// LogStream is the log stream of the originating log data
	LogStream string `json:"logStream"`

	// SubscriptionFilters is the list of subscription filter names
	// that matched with the originating log data
	SubscriptionFilters []string `json:"subscriptionFilters"`

	// MessageType describes the type of LogEvents this record carries.
	// Data messages will use the "DATA_MESSAGE" type. Sometimes CloudWatch
	// Logs may emit Kinesis Data Streams records with a "CONTROL_MESSAGE" type,
	// mainly for checking if the destination is reachable.
	MessageType string `json:"messageType"`

	// LogEvents contains the actual log data.
	LogEvents []CloudwatchLogEvent `json:"logEvents"`
}

CloudwatchLogsRecord is an envelope around a series of logging events, according to https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#DestinationKinesisExample

type FirehoseRecord

type FirehoseRecord struct {
	Data string `json:"data"`
}

FirehoseRecord is an envelope around a sole data record, received over Firehose HTTP API.

type FirehoseRequest

type FirehoseRequest struct {
	RequestID string           `json:"requestId"`
	Timestamp int64            `json:"timestamp"`
	Records   []FirehoseRecord `json:"records"`
}

FirehoseRequest implements AWS Firehose HTTP request format, according to the following appendix https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html#requestformat

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements a http.Handler that is able to receive records from a Firehose HTTP destination.

func NewHandler

func NewHandler(sender Sender, logger log.Logger, metrics *Metrics, rbs []*relabel.Config, useIncomingTs bool, accessKey string) *Handler

NewHandler creates a new handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP satisfies the http.Handler interface.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(reg prometheus.Registerer) *Metrics

type RecordOrigin

type RecordOrigin string

RecordOrigin is a type that tells from which origin the data received from AWS Firehose comes.

const (
	OriginCloudwatchLogs RecordOrigin = "cloudwatch-logs"
	OriginDirectPUT      RecordOrigin = "direct-put"
	OriginUnknown        RecordOrigin = "unknown"
)

type Sender

type Sender interface {
	Send(ctx context.Context, entry loki.Entry)
}

Sender is an interface that decouples the Firehose request handler from the destination where read loki entries should be written to.

Jump to

Keyboard shortcuts

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