file

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package file provides an otelcol.storage.file component.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Arguments{

		Timeout: time.Second,

		FSync:                false,
		CreateDirectory:      true,
		DirectoryPermissions: "0750",
	}
)

defaults copied from OpenTelemetry Collector

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	// Directory specifies the directory where the file storage will store its data.
	Directory string `alloy:"directory,attr,optional"`

	// Timeout specifies the timeout for file storage operations.
	Timeout time.Duration `alloy:"timeout,attr,optional"`

	// Compaction configures file storage compaction.
	Compaction *CompactionConfig `alloy:"compaction,block,optional"`

	// FSync specifies that fsync should be called after each database write.
	FSync bool `alloy:"fsync,attr,optional"`

	// CreateDirectory specifies that the directory should be created automatically by the extension on start.
	CreateDirectory bool `alloy:"create_directory,attr,optional"`

	// DirectoryPermissions specifies the permissions for the directory if it must be created.
	DirectoryPermissions string `alloy:"directory_permissions,attr,optional"`

	DebugMetrics otelcolCfg.DebugMetricsArguments `alloy:"debug_metrics,block,optional"`
}

Arguments configures the otelcol.file.storage component.

func (Arguments) Convert

func (args Arguments) Convert(opts component.Options) (otelcomponent.Config, error)

Convert implements extension.Arguments.

func (Arguments) DebugMetricsConfig

func (args Arguments) DebugMetricsConfig() otelcolCfg.DebugMetricsArguments

DebugMetricsConfig implements extension.Arguments.

func (Arguments) Exporters

func (args Arguments) Exporters() map[pipeline.Signal]map[otelcomponent.ID]otelcomponent.Component

Exporters implements extension.Arguments.

func (Arguments) ExportsHandler

func (args Arguments) ExportsHandler() bool

ExportsHandler implements extension.Arguments.

func (Arguments) Extensions

func (args Arguments) Extensions() map[otelcomponent.ID]otelcomponent.Component

Extensions implements extension.Arguments.

func (*Arguments) SetToDefault

func (args *Arguments) SetToDefault()

SetToDefault implements syntax.Defaulter.

func (*Arguments) Validate

func (args *Arguments) Validate() error

type CompactionConfig

type CompactionConfig struct {
	// OnStart specifies that compaction is attempted each time on start.
	OnStart bool `alloy:"on_start,attr,optional"`

	// OnRebound specifies that compaction is attempted online, when rebound conditions are met.
	OnRebound bool `alloy:"on_rebound,attr,optional"`

	// Directory specifies where the temporary files for compaction will be stored.
	Directory string `alloy:"directory,attr,optional"`

	// ReboundNeededThresholdMiB specifies the minimum total allocated size (both used and empty)
	// to mark the need for online compaction.
	ReboundNeededThresholdMiB int64 `alloy:"rebound_needed_threshold_mib,attr,optional"`

	// ReboundTriggerThresholdMiB is used when compaction is marked as needed. When used allocated data size drops
	// below the specified value, the compaction starts and the flag marking need for compaction is cleared.
	ReboundTriggerThresholdMiB int64 `alloy:"rebound_trigger_threshold_mib,attr,optional"`

	// MaxTransactionSize specifies the maximum number of items that might be present in a single compaction iteration.
	MaxTransactionSize int64 `alloy:"max_transaction_size,attr,optional"`

	// CheckInterval specifies the frequency of compaction checks.
	CheckInterval time.Duration `alloy:"check_interval,attr,optional"`

	// CleanupOnStart specifies that removal of temporary files is performed on start.
	CleanupOnStart bool `alloy:"cleanup_on_start,attr,optional"`
}

CompationConfig configures optional file storage compaction.

func (*CompactionConfig) Convert

Convert converts the CompactionConfig to the underlying config type.

Jump to

Keyboard shortcuts

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