cloudflare

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	Workers:    3,
	PullRange:  1 * time.Minute,
	FieldsType: FieldsTypeDefault,
}

DefaultArguments sets the configuration defaults.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	APIToken         alloytypes.Secret   `alloy:"api_token,attr"`
	ZoneID           string              `alloy:"zone_id,attr"`
	Labels           map[string]string   `alloy:"labels,attr,optional"`
	Workers          int                 `alloy:"workers,attr,optional"`
	PullRange        time.Duration       `alloy:"pull_range,attr,optional"`
	FieldsType       FieldsType          `alloy:"fields_type,attr,optional"`
	AdditionalFields []string            `alloy:"additional_fields,attr,optional"`
	ForwardTo        []loki.LogsReceiver `alloy:"forward_to,attr"`
}

Arguments holds values which are used to configure the loki.source.cloudflare component.

func (*Arguments) SetToDefault

func (c *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*Arguments) Validate

func (c *Arguments) Validate() error

Validate implements syntax.Validator.

type Client added in v1.13.0

type Client interface {
	LogpullReceived(ctx context.Context, start, end time.Time) (cloudflare.LogpullReceivedIterator, error)
}

Client is a wrapper around the Cloudflare API that allow for testing and being zone/fields aware.

type Component

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

Component implements the loki.source.cloudflare component.

func New

func New(o component.Options, args Arguments) (*Component, error)

New creates a new loki.source.cloudflare component.

func (*Component) DebugInfo

func (c *Component) DebugInfo() any

DebugInfo returns information about the status of targets.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run implements component.Component.

func (*Component) Update

func (c *Component) Update(args component.Arguments) error

Update implements component.Component.

type FieldsType added in v1.13.0

type FieldsType string

FieldsType defines the set of fields to fetch alongside logs.

const (
	FieldsTypeDefault  FieldsType = "default"
	FieldsTypeMinimal  FieldsType = "minimal"
	FieldsTypeExtended FieldsType = "extended"
	FieldsTypeAll      FieldsType = "all"
	FieldsTypeCustom   FieldsType = "custom"
)

Valid FieldsType values.

func (FieldsType) MarshalText added in v1.13.0

func (ft FieldsType) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler.

func (*FieldsType) UnmarshalText added in v1.13.0

func (ft *FieldsType) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Jump to

Keyboard shortcuts

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