Skip to content

Commit

Permalink
config: support v0.3 of the config schema (#6126)
Browse files Browse the repository at this point in the history
Adding support for [v0.3.0
release](https://github.com/open-telemetry/opentelemetry-configuration/releases/tag/v0.3.0)
of otel configuration.

As part of the changes, i moved the unmarshaling code into its of file
for each format (config_json.go and config_yaml.go) to ensure the
resulting struct is consistent. Validated this through unit tests

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
  • Loading branch information
3 people authored Oct 11, 2024
1 parent 20e45af commit 45ba204
Show file tree
Hide file tree
Showing 17 changed files with 1,969 additions and 596 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- The deprecated `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` package is removed. (#6186)
- The deprecated `go.opentelemetry.io/contrib/samplers/aws/xray` package is removed. (#6187)

### Changed

- Updated `go.opentelemetry.io/contrib/config` to use the [v0.3.0](https://github.com/open-telemetry/opentelemetry-configuration/releases/tag/v0.3.0) release of schema which includes backwards incompatible changes. (#6126)

<!-- Released section -->
<!-- Don't change this section unless doing release -->

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ update-all-otel-deps:
OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR=tmp/opentelememetry-configuration

# The SHA matching the current version of the opentelemetry-configuration schema to use
OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION=v0.2.0
OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_VERSION=v0.3.0

# Cleanup temporary directory
genjsonschema-cleanup:
Expand All @@ -326,6 +326,7 @@ genjsonschema: genjsonschema-cleanup $(GOJSONSCHEMA)
--capitalization OTLP \
--struct-name-from-title \
--package config \
--only-models \
--output ${GENERATED_CONFIG} \
${OPENTELEMETRY_CONFIGURATION_JSONSCHEMA_SRC_DIR}/schema/opentelemetry_configuration.json
@echo Modify jsonschema generated files.
Expand Down
8 changes: 8 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,11 @@ func ParseYAML(file []byte) (*OpenTelemetryConfiguration, error) {

return &cfg, nil
}

func toStringMap(pairs []NameStringValuePair) map[string]string {
output := make(map[string]string)
for _, v := range pairs {
output[v.Name] = *v.Value
}
return output
}
Loading

0 comments on commit 45ba204

Please sign in to comment.