otelcolmetadataschema

package module
v0.0.0-...-890d5ca Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: CC-BY-4.0 Imports: 1 Imported by: 0

README

otelcol-metadata-schema

GitHub License go-version

JSON Schema for OpenTelemetry Collector metadata.yaml and its generator

The description of aggregation_temporality is shown on the VSCode.

How to Use

# yaml-language-server: $schema=https://raw.githubusercontent.com/Arthur1/otelcol-metadata-schema/main/metadata.schema.json

type: sample
scope_name: go.opentelemetry.io/collector/internal/receiver/samplereceiver

...

Generate JSON Schema File

$ pwd
/path/to/otelcol-metadata-schema
$ go generate .

License

Source Code

MIT License

Schema File

CC BY 4.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Description  string         `json:"description" jsonschema_description:"description of the attribute."`
	NameOverride string         `` /* 220-byte string literal not displayed */
	Include      []FilterConfig `json:"include,omitempty"`
	Exclude      []FilterConfig `json:"exclude,omitempty"`
	Enum         []string       `` /* 143-byte string literal not displayed */
	Type         string         `` /* 145-byte string literal not displayed */

}

type AttributeName

type AttributeName string

type Codeowners

type Codeowners struct {
	Active     []string `json:"active,omitempty"`
	Emeritus   []string `json:"emeritus,omitempty"`
	SeekingNew bool     `json:"seeking_new,omitempty"`
}

type FilterConfig

type FilterConfig struct {
	Strict string `json:"strict,omitempty" jsonschema:"oneof_required=filter"`
	Regex  string `json:"regexp,omitempty" jsonschema:"oneof_required=filter"`
}

type Gauge

type Gauge struct {
	MetricValueType string `json:"value_type" jsonschema_description:"type of number data point values."`
	MetricInputType string `` /* 187-byte string literal not displayed */
}

type GoLeak

type GoLeak struct {
	Skip     bool   `json:"skip" jsonschema_description:"set to true if goleak tests should be skipped"`
	Ignore   Ignore `json:"ignore,omitempty"`
	Setup    string `json:"setup,omitempty" jsonschema_description:"upports configuring a setup function that runs before goleak checks"`
	Teardown string `json:"teardown,omitempty" jsonschema_description:"supports configuring a teardown function that runs before goleak checks"`
}

type Ignore

type Ignore struct {
	Top []string `` /* 129-byte string literal not displayed */
	Any []string `` /* 129-byte string literal not displayed */
}

type Metadata

type Metadata struct {
	Type               string                              `` /* 217-byte string literal not displayed */
	Parent             string                              `json:"parent,omitempty" jsonschema_description:"Required for subcomponents: The type of the parent component."`
	Status             *Status                             `` /* 172-byte string literal not displayed */
	SemConvVersion     string                              `` /* 225-byte string literal not displayed */
	ResourceAttributes map[AttributeName]ResourceAttribute `` /* 138-byte string literal not displayed */
	Attributes         map[AttributeName]Attribute         `` /* 152-byte string literal not displayed */
	Metrics            map[MetricName]Metric               `` /* 138-byte string literal not displayed */
	Telemetry          map[MetricName]Metric               `` /* 140-byte string literal not displayed */
	ScopeName          string                              `json:"scope_name,omitempty"`
	// ShortFolderName    string               `json:"-"`
	Tests Tests `json:"tests,omitempty" jsonschema_description:"Lifecycle tests generated for this component."`
}

type Metric

type Metric struct {
	Enabled               bool            `json:"enabled" jsonschema_description:"whether the metric is collected by default."`
	Warnings              Warnings        `json:"warnings,omitempty" jsonschema_description:"warnings that will be shown to user under specified conditions."`
	Description           string          `json:"description" jsonschema_description:"metric description."`
	ExtendedDocumentation string          `json:"extended_documentation,omitempty" jsonschema_description:"extended documentation of the metric."`
	Unit                  *string         `` /* 128-byte string literal not displayed */
	Sum                   *Sum            `json:"sum,omitempty" jsonschema:"oneof_required:metrictype" jsonschema_description:"metric type with its settings."`
	Gauge                 *Gauge          `json:"gauge,omitempty" jsonschema:"oneof_required:metrictype" jsonschema_description:"metric type with its settings."`
	Attributes            []AttributeName `` /* 149-byte string literal not displayed */
}

type MetricName

type MetricName string

type ResourceAttribute

type ResourceAttribute struct {
	Description string         `json:"description" jsonschema_description:"description of the attribute."`
	Enabled     bool           `json:"enabled" jsonschema_description:"whether the resource attribute is added the emitted metrics by default."`
	Include     []FilterConfig `json:"include,omitempty"`
	Exclude     []FilterConfig `json:"exclude,omitempty"`
	Enum        []string       `` /* 142-byte string literal not displayed */
	Type        string         `` /* 145-byte string literal not displayed */
	// FullName     attributeName   `json:"-"`
	Warnings Warnings `json:"warnings,omitempty" jsonschema_description:"warnings that will be shown to user under specified conditions."`
}

type Stability

type Stability struct {
	Development  []StabilityItem `json:"development,omitempty"`
	Alpha        []StabilityItem `json:"alpha,omitempty"`
	Beta         []StabilityItem `json:"beta,omitempty"`
	Stable       []StabilityItem `json:"stable,omitempty"`
	Deprecated   []StabilityItem `json:"deprecated,omitempty"`
	Unmaintained []StabilityItem `json:"unmaintained,omitempty"`
}

type StabilityItem

type StabilityItem string

func (StabilityItem) JSONSchema

func (StabilityItem) JSONSchema() *jsonschema.Schema

type Status

type Status struct {
	Stability            Stability   `` /* 153-byte string literal not displayed */
	Distributions        []string    `` /* 188-byte string literal not displayed */
	Class                string      `` /* 191-byte string literal not displayed */
	Warnings             []string    `` /* 148-byte string literal not displayed */
	Codeowners           *Codeowners `json:"codeowners,omitempty" jsonschema_description:"Metadata related to codeowners of the component"`
	UnsupportedPlatforms []string    `json:"unsupported_platforms,omitempty"`
}

type Sum

type Sum struct {
	AggregationTemporality string `` /* 142-byte string literal not displayed */
	Mono                   bool   `json:"monotonic" jsonschema_description:"whether the metric is monotonic (no negative delta values)."`
	MetricValueType        string `json:"value_type" jsonschema_description:"type of number data point values."`
	MetricInputType        string `` /* 187-byte string literal not displayed */
}

type Tests

type Tests struct {
	Config              any    `json:"config,omitempty" jsonschema_description:"{} by default, specific testing configuration for lifecycle tests."`
	SkipLifecycle       bool   `` /* 174-byte string literal not displayed */
	SkipShutdown        bool   `` /* 172-byte string literal not displayed */
	GoLeak              GoLeak `json:"goleak,omitempty" jsonschema_description:"{} by default generates a package_test to enable check for leaks"`
	ExpectConsumerError bool   `` /* 181-byte string literal not displayed */
}

type Warnings

type Warnings struct {
	IfEnabled       string `json:"if_enabled,omitempty"`
	IfEnabledNotSet string `json:"if_enabled_not_set,omitempty"`
	IfConfigured    string `json:"if_configured,omitempty"`
}

Directories

Path Synopsis
cmd
schemagen command

Jump to

Keyboard shortcuts

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