From c1ac3039d0bb7cdf83630210f8209b7d0b95cd48 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Fri, 10 Nov 2023 00:57:10 -0600 Subject: [PATCH] config: Prepare module for release (#4541) --- config/README.md | 31 ------------------------------- config/config.go | 7 +++++++ config/doc.go | 7 +++++++ versions.yaml | 5 ++++- 4 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 config/README.md create mode 100644 config/doc.go diff --git a/config/README.md b/config/README.md deleted file mode 100644 index bc907dfaf1a..00000000000 --- a/config/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# Configuration Library - -This package can be used to parse a configuration file that follows the JSON -Schema defined by the [OpenTelemetry Configuration] schema. - -The package contains: - -- models generated via the JSON schema using the [go-jsonschema] library -- a `Create` function that interprets [configuration model] and return SDK components (TODO) -- a `Parse` function that parses and validates a [configuration file] (TODO) - -## Using the generate model code - -The `generated_config.go` code in versioned submodule can be used directly as-is to programmatically -produce a configuration model that can be then used as a parameter to the `Create` function. Note -that the package is versioned to match the release versioning of the opentelemetry-configuration -repository. - -## Using the `Create` function (TODO) - -## Using the `Parse` function (TODO) - -The original code from the package comes from the [OpenTelemetry Collector's service] telemetry -configuration code. The intent being to share this code across implementations and reduce -duplication where possible. - -[OpenTelemetry Configuration]: https://github.com/open-telemetry/opentelemetry-configuration/ -[go-jsonschema]: https://github.com/omissis/go-jsonschema -[configuration model]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#configuration-model -[configuration file]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#configuration-file -[OpenTelemetry Collector's service]: https://github.com/open-telemetry/opentelemetry-collector/blob/7c5ecef11dff4ce5501c9683b277a25a61ea0f1a/service/telemetry/generated_config.go diff --git a/config/config.go b/config/config.go index 8d77a783369..c49772a8e69 100644 --- a/config/config.go +++ b/config/config.go @@ -72,3 +72,10 @@ func WithOpenTelemetryConfiguration(cfg OpenTelemetryConfiguration) Configuratio return c }) } + +// TODO: implement parsing functionality: +// - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4373 +// - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4412 + +// TODO: create SDK from the model: +// - https://github.com/open-telemetry/opentelemetry-go-contrib/issues/4371 diff --git a/config/doc.go b/config/doc.go new file mode 100644 index 00000000000..293b43abb25 --- /dev/null +++ b/config/doc.go @@ -0,0 +1,7 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package config can be used to parse a configuration file +// that follows the JSON Schema defined by the OpenTelemetry +// Configuration schema. +package config // import "go.opentelemetry.io/contrib/config" diff --git a/versions.yaml b/versions.yaml index 353af94b42b..85cf89a24de 100644 --- a/versions.yaml +++ b/versions.yaml @@ -83,8 +83,11 @@ module-sets: - go.opentelemetry.io/contrib/samplers/jaegerremote - go.opentelemetry.io/contrib/samplers/jaegerremote/example - go.opentelemetry.io/contrib/samplers/probability/consistent + experimental-config: + version: v0.1.0 + modules: + - go.opentelemetry.io/contrib/config excluded-modules: - - go.opentelemetry.io/contrib/config - go.opentelemetry.io/contrib/instrgen - go.opentelemetry.io/contrib/instrgen/driver - go.opentelemetry.io/contrib/instrgen/testdata/interface