mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Restricts Environment Variable names according to the [restrictions](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution) published by the OpenTelemetry Configuration Working Group. Changes both the expand converter and the env provider. Defines one regex to be used for both of these. <!-- Issue number if applicable --> #### Link to tracking issue Fixes https://github.com/open-telemetry/opentelemetry-collector/issues/9531 <!--Describe what testing was performed and which tests were added.--> #### Testing Unit tests <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: Pablo Baeyens <[email protected]>
11 lines
293 B
Go
11 lines
293 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package envvar // import "go.opentelemetry.io/collector/confmap/internal/envvar"
|
|
|
|
import "regexp"
|
|
|
|
const ValidationPattern = `^[a-zA-Z_][a-zA-Z0-9_]*$`
|
|
|
|
var ValidationRegexp = regexp.MustCompile(ValidationPattern)
|