internal

package
v0.110.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Distros = map[string]string{
	"core":    "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol",
	"contrib": "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib",
	"k8s":     "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-k8s",
}

distros is a collection of distributions that can be referenced in the metadata.yaml files. The rules below apply to every distribution added to this list: - The distribution is open source and maintained by the OpenTelemetry project. - The link must point to a publicly accessible repository.

View Source
var TemplateFS embed.FS

TemplateFS ensures that the files needed to generate metadata as an embedded filesystem since `go get` doesn't require these files to be downloaded.

Functions

func FormatIdentifier

func FormatIdentifier(s string, exported bool) (string, error)

FormatIdentifier variable in a go-safe way

func NewCommand

func NewCommand() (*cobra.Command, error)

NewCommand constructs a new cobra.Command using the given Settings. Any URIs specified in CollectorSettings.ConfigProviderSettings.ResolverSettings.URIs are considered defaults and will be overwritten by config flags passed as command-line arguments to the executable. At least one Provider must be set.

Types

type AggregationTemporality

type AggregationTemporality struct {
	// Aggregation describes if the aggregator reports delta changes
	// since last report time, or cumulative changes since a fixed start time.
	Aggregation pmetric.AggregationTemporality
}

AggregationTemporality defines a metric aggregation type.

func (*AggregationTemporality) String

func (agg *AggregationTemporality) String() string

String returns string representation of the aggregation temporality.

func (*AggregationTemporality) UnmarshalText

func (agg *AggregationTemporality) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Attribute

type Attribute struct {
	// Description describes the purpose of the attribute.
	Description string `mapstructure:"description"`
	// NameOverride can be used to override the attribute name.
	NameOverride string `mapstructure:"name_override"`
	// Enabled defines whether the attribute is enabled by default.
	Enabled bool `mapstructure:"enabled"`
	// Include can be used to filter attributes.
	Include []filter.Config `mapstructure:"include"`
	// Include can be used to filter attributes.
	Exclude []filter.Config `mapstructure:"exclude"`
	// Enum can optionally describe the set of values to which the attribute can belong.
	Enum []string `mapstructure:"enum"`
	// Type is an attribute type.
	Type ValueType `mapstructure:"type"`
	// FullName is the attribute name populated from the map key.
	FullName AttributeName `mapstructure:"-"`
	// Warnings that will be shown to user under specified conditions.
	Warnings warnings `mapstructure:"warnings"`
}

func (Attribute) Name

func (a Attribute) Name() AttributeName

Name returns actual name of the attribute that is set on the metric after applying NameOverride.

func (Attribute) TestValue

func (a Attribute) TestValue() string

type AttributeName

type AttributeName string

func (AttributeName) Render

func (mn AttributeName) Render() (string, error)

func (AttributeName) RenderUnexported

func (mn AttributeName) RenderUnexported() (string, error)

type Codeowners

type Codeowners struct {
	// Active codeowners
	Active []string `mapstructure:"active"`
	// Emeritus codeowners
	Emeritus []string `mapstructure:"emeritus"`
	// Whether new codeowners are being sought
	SeekingNew bool `mapstructure:"seeking_new"`
}

type Metadata

type Metadata struct {
	// Type of the component.
	Type string `mapstructure:"type"`
	// Type of the parent component (applicable to subcomponents).
	Parent string `mapstructure:"parent"`
	// Status information for the component.
	Status *Status `mapstructure:"status"`
	// Telemetry information for the component.
	Telemetry telemetry `mapstructure:"telemetry"`
	// SemConvVersion is a version number of OpenTelemetry semantic conventions applied to the scraped metrics.
	SemConvVersion string `mapstructure:"sem_conv_version"`
	// ResourceAttributes that can be emitted by the component.
	ResourceAttributes map[AttributeName]Attribute `mapstructure:"resource_attributes"`
	// Attributes emitted by one or more metrics.
	Attributes map[AttributeName]Attribute `mapstructure:"attributes"`
	// Metrics that can be emitted by the component.
	Metrics map[MetricName]Metric `mapstructure:"metrics"`
	// GithubProject is the project where the component README lives in the format of org/repo, defaults to open-telemetry/opentelemetry-collector-contrib
	GithubProject string `mapstructure:"github_project"`
	// ScopeName of the metrics emitted by the component.
	ScopeName string `mapstructure:"scope_name"`
	// ShortFolderName is the shortened folder name of the component, removing class if present
	ShortFolderName string `mapstructure:"-"`
	// Tests is the set of tests generated with the component
	Tests tests `mapstructure:"tests"`
}

func LoadMetadata

func LoadMetadata(filePath string) (Metadata, error)

func (*Metadata) Validate

func (md *Metadata) Validate() error

type Metric

type Metric struct {
	// Enabled defines whether the metric is enabled by default.
	Enabled bool `mapstructure:"enabled"`

	// Warnings that will be shown to user under specified conditions.
	Warnings warnings `mapstructure:"warnings"`

	// Description of the metric.
	Description string `mapstructure:"description"`

	// The stability level of the metric.
	Stability stability `mapstructure:"stability"`

	// ExtendedDocumentation of the metric. If specified, this will
	// be appended to the description used in generated documentation.
	ExtendedDocumentation string `mapstructure:"extended_documentation"`

	// Optional can be used to specify metrics that may
	// or may not be present in all cases, depending on configuration.
	Optional bool `mapstructure:"optional"`

	// Unit of the metric.
	Unit *string `mapstructure:"unit"`

	// Sum stores metadata for sum metric type
	Sum *sum `mapstructure:"sum,omitempty"`
	// Gauge stores metadata for gauge metric type
	Gauge *gauge `mapstructure:"gauge,omitempty"`
	// Histogram stores metadata for histogram metric type
	Histogram *histogram `mapstructure:"histogram,omitempty"`

	// Attributes is the list of attributes that the metric emits.
	Attributes []AttributeName `mapstructure:"attributes"`

	// Level specifies the minimum `configtelemetry.Level` for which
	// the metric will be emitted. This only applies to internal telemetry
	// configuration.
	Level configtelemetry.Level `mapstructure:"level"`
}

func (Metric) Data

func (m Metric) Data() MetricData

func (*Metric) Unmarshal

func (m *Metric) Unmarshal(parser *confmap.Conf) error

type MetricData

type MetricData interface {
	Type() string
	HasMonotonic() bool
	HasAggregated() bool
	HasMetricInputType() bool
	Instrument() string
	IsAsync() bool
}

MetricData is generic interface for all metric datatypes.

type MetricInputType

type MetricInputType struct {
	// InputType is the type the metric needs to be parsed from, options are "string"
	InputType string `mapstructure:"input_type"`
}

MetricInputType defines the metric input value type

func (MetricInputType) HasMetricInputType

func (mit MetricInputType) HasMetricInputType() bool

func (MetricInputType) String

func (mit MetricInputType) String() string

Type returns name of the datapoint type.

func (MetricInputType) Validate

func (mit MetricInputType) Validate() error

type MetricName

type MetricName string

func (MetricName) Render

func (mn MetricName) Render() (string, error)

func (MetricName) RenderUnexported

func (mn MetricName) RenderUnexported() (string, error)

type MetricValueType

type MetricValueType struct {
	// ValueType is type of the metric number, options are "double", "int".
	ValueType pmetric.NumberDataPointValueType
}

MetricValueType defines the metric number type.

func (MetricValueType) BasicType

func (mvt MetricValueType) BasicType() string

BasicType returns name of a golang basic type for the datapoint type.

func (MetricValueType) String

func (mvt MetricValueType) String() string

Type returns name of the datapoint type.

func (*MetricValueType) Unmarshal

func (mvt *MetricValueType) Unmarshal(parser *confmap.Conf) error

func (*MetricValueType) UnmarshalText

func (mvt *MetricValueType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Mono

type Mono struct {
	// Monotonic is true if the sum is monotonic.
	Monotonic bool `mapstructure:"monotonic"`
}

Mono defines the metric monotonicity.

type StabilityMap

type StabilityMap map[component.StabilityLevel][]string

func (*StabilityMap) Unmarshal

func (ms *StabilityMap) Unmarshal(parser *confmap.Conf) error

type Status

type Status struct {
	Stability            StabilityMap `mapstructure:"stability"`
	Distributions        []string     `mapstructure:"distributions"`
	Class                string       `mapstructure:"class"`
	Warnings             []string     `mapstructure:"warnings"`
	Codeowners           *Codeowners  `mapstructure:"codeowners"`
	UnsupportedPlatforms []string     `mapstructure:"unsupported_platforms"`
	NotComponent         bool         `mapstructure:"not_component"`
}

func (*Status) SortedDistributions

func (s *Status) SortedDistributions() []string

type TemplateContext

type TemplateContext struct {
	Metadata
	// Package name for generated code.
	Package string
}

type ValueType

type ValueType struct {
	// ValueType is type of the attribute value.
	ValueType pcommon.ValueType
}

ValueType defines an attribute value type.

func (ValueType) Primitive

func (mvt ValueType) Primitive() string

Primitive returns name of primitive type for the ValueType.

func (ValueType) String

func (mvt ValueType) String() string

String returns capitalized name of the ValueType.

func (*ValueType) UnmarshalText

func (mvt *ValueType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

Directories

Path Synopsis
Deprecated: This package is moving to https://github.com/open-telemetry/opentelemetry-collector and will eventually be removed.
Deprecated: This package is moving to https://github.com/open-telemetry/opentelemetry-collector and will eventually be removed.

Jump to

Keyboard shortcuts

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