ast

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

README

Schema v1.1 AST

PkgGoDev

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Changes []MetricsChange
}

Metrics corresponds to a section representing a list of changes that happened to metrics schema in a particular version.

type MetricsChange

type MetricsChange struct {
	RenameMetrics    map[types10.MetricName]types10.MetricName `yaml:"rename_metrics"`
	RenameAttributes *ast10.AttributeMapForMetrics             `yaml:"rename_attributes"`
	Split            *SplitMetric                              `yaml:"split"`
}

MetricsChange corresponds to a section representing metrics change.

type Schema

type Schema struct {
	// Schema file format. SHOULD be 1.1.0 for the current specification version.
	// See https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md#schema-file-format-number
	FileFormat string `yaml:"file_format"`

	// Schema URL is an identifier of a Schema. The URL specifies a location of this
	// Schema File that can be retrieved (so it is a URL and not just a URI) using HTTP
	// or HTTPS protocol.
	// See https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md#schema-url
	SchemaURL string `yaml:"schema_url"`

	// Versions section that lists changes that happened in each particular version.
	Versions map[types.TelemetryVersion]VersionDef
}

Schema represents a Schema file in FileFormat 1.1.0 as defined in https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md

type SplitMetric

type SplitMetric struct {
	// Name of the old metric to split.
	ApplyToMetric types10.MetricName `yaml:"apply_to_metric"`

	// Name of attribute in the old metric to use for splitting. The attribute will be
	// eliminated, the new metric will not have it.
	ByAttribute types11.AttributeName `yaml:"by_attribute"`

	// Names of new metrics to create, one for each possible value of attribute.
	// map of key/values. The keys are the new metric name starting from this version,
	// the values are old attribute value used in the previous version.
	MetricsFromAttributes map[types10.MetricName]types11.AttributeValue `yaml:"metrics_from_attributes"`
}

SplitMetric corresponds to a section representing a splitting of a metric into multiple metrics by eliminating an attribute. SplitMetrics is introduced in schema file format 1.1, see https://github.com/open-telemetry/opentelemetry-specification/pull/2653

type VersionDef

type VersionDef struct {
	All        ast10.Attributes
	Resources  ast10.Attributes
	Spans      ast10.Spans
	SpanEvents ast10.SpanEvents `yaml:"span_events"`
	Logs       ast10.Logs
	Metrics    Metrics
}

VersionDef corresponds to a section representing one version under the "versions" top-level key. Note that most of the fields are the same as in ast 1.0 package, only Metrics are defined differently, since only that field has changed from 1.0 to 1.1 of schema file format.

Jump to

Keyboard shortcuts

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