Documentation ¶
Index ¶
- Variables
- func FormatIdentifier(s string, exported bool) (string, error)
- func NewCommand() (*cobra.Command, error)
- type AggregationTemporality
- type Attribute
- type AttributeName
- type Codeowners
- type Metadata
- type Metric
- type MetricData
- type MetricInputType
- type MetricName
- type MetricValueType
- type Mono
- type StabilityMap
- type Status
- type TemplateContext
- type ValueType
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
FormatIdentifier variable in a go-safe way
func NewCommand ¶
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.
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 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 ¶
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
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
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 ¶
type TemplateContext ¶
type ValueType ¶
ValueType defines an attribute value type.
func (*ValueType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
Source Files ¶
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. |