logtometric

package
v0.0.0-...-fb5a1ab Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsKindAbsolute MetricsKind = "absolute"

	// MetricsKindIncremental default if not defined
	MetricsKindIncremental MetricsKind = "incremental"

	MetricsTypeCounter MetricsType = "counter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogToMetric

type LogToMetric struct {
	// Type is required to be 'log_to_metric'
	Type string `json:"type" yaml:"type" toml:"type"`

	// Inputs is the IDs of the components feeding into this component
	Inputs []string `json:"inputs" yaml:"inputs" toml:"inputs"`

	// Metrics is the spec for the Metrics being exposed
	Metrics []Metric `json:"metrics" yaml:"metrics" toml:"metrics"`
}

LogToMetric is the configuration for the log_to_metric transform

func New

func New(name string, metricsType MetricsType, tags Tags, inputs ...string) *LogToMetric

type Metric

type Metric struct {
	Field string `json:"field" yaml:"field" toml:"field"`

	MetricName string `json:"name,omitempty" yaml:"name,omitempty" toml:"name,omitempty"`

	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty" toml:"namespace,omitempty"`

	Kind MetricsKind `json:"kind,omitempty" yaml:"kind,omitempty" toml:"kind,omitempty"`

	Type MetricsType `json:"type" yaml:"type" toml:"type"`

	// Tags optional tags (or labels) to apply to the metric
	Tags Tags `json:"tags,omitempty" yaml:"tags,omitempty"  toml:"tags,omitempty,multiline"`
}

type MetricsKind

type MetricsKind string

type MetricsType

type MetricsType string

type Tags

type Tags map[string]string

Tags optional tags (or labels) to apply to the metric

func (Tags) AddAll

func (t Tags) AddAll(tags map[string]string)

func (Tags) MarshalTOML

func (t Tags) MarshalTOML() ([]byte, error)

Jump to

Keyboard shortcuts

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