| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
// Package ast provides abstract syntax tree parsing for the OpenTelemetry |
| 5 |
// schema. |
| 6 |
package ast // import "go.opentelemetry.io/otel/schema/v1.0/ast" |
| 7 |
|
| 8 |
import "go.opentelemetry.io/otel/schema/v1.0/types" |
| 9 |
|
| 10 |
// Schema represents a Schema file in FileFormat 1.0.0 as defined in |
| 11 |
// https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md |
| 12 |
type Schema struct { |
| 13 |
// Schema file format. SHOULD be 1.0.0 for the current specification version. |
| 14 |
// See https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md#schema-file-format-number |
| 15 |
FileFormat string `yaml:"file_format"` |
| 16 |
|
| 17 |
// Schema URL is an identifier of a Schema. The URL specifies a location of this |
| 18 |
// Schema File that can be retrieved (so it is a URL and not just a URI) using HTTP |
| 19 |
// or HTTPS protocol. |
| 20 |
// See https://github.com/open-telemetry/oteps/blob/main/text/0152-telemetry-schemas.md#schema-url |
| 21 |
SchemaURL string `yaml:"schema_url"` |
| 22 |
|
| 23 |
// Versions section that lists changes that happened in each particular version. |
| 24 |
Versions map[types.TelemetryVersion]VersionDef |
| 25 |
} |
| 26 |
|
| 27 |
// VersionDef corresponds to a section representing one version under the "versions" |
| 28 |
// top-level key. |
| 29 |
type VersionDef struct { |
| 30 |
All Attributes |
| 31 |
Resources Attributes |
| 32 |
Spans Spans |
| 33 |
SpanEvents SpanEvents `yaml:"span_events"` |
| 34 |
Logs Logs |
| 35 |
Metrics Metrics |
| 36 |
} |
| 37 |
|
| 38 |
// Attributes corresponds to a section representing a list of changes that |
| 39 |
// happened in a particular version. |
| 40 |
type Attributes struct { |
| 41 |
Changes []AttributeChange |
| 42 |
} |
| 43 |
|
| 44 |
// AttributeChange corresponds to a section representing attribute changes. |
| 45 |
type AttributeChange struct { |
| 46 |
RenameAttributes *RenameAttributes `yaml:"rename_attributes"` |
| 47 |
} |