mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
`make gotest` failed at cmd/builder with 16 failures, but only one was about
the builder. The other three could not even build a collector — the tree they
compile has been broken since an incomplete sync left calls without their
definitions.
confmap/internal/decoder.go called NewExpandedValueSanitizer and
sanitizeToStr. Both exist under the names they were generated with:
metadata.ConfmapNewExpandedValueSanitizerFeatureGate, and
sanitizeExpanded(data, true) — the string arm of the same helper
sanitize() takes the false arm of, which is what the comment above the
call describes.
service/metadata.yaml never declared telemetry.newPipelineTelemetry, so
mdatagen never generated the gate that 22 call sites use. Declared it as
the CHANGELOG describes it — alpha, v0.123.0, PR #12217 — and added the
generated entry, because mdatagen itself does not build (undefined:
cfggen, still outstanding).
confmap/xconfmap declared WithForceUnmarshaler twice, byte for byte.
otelcol wanted xconfmap.WithUnredacted. MarshalOptions.OpaqueUnredacted and
its hook were both there; only the exported option was missing, in the
package whose own comment says experimental options go there.
receivertest called atomic.AddInt64 on an atomic.Int64.
otelconftelemetry computed metricsHost from the localhost gate and then
hardcoded ptr("localhost"), so the gate did nothing. The compiler said so:
declared and not used.
confighttp used slices.Backward without importing slices.
multi_batcher's Shutdown still ranged over a sync.Map field the struct no
longer has; partitions is a typed LRU now, and every other reader takes
the lock, so this one does too.
otelconf is v0.23.0, the first release where SDK exposes Resource(), which
createResource calls.
The one real builder bug: Config's component lists had no omitempty, so
MarshalYAML wrote connectors: null and converters: null for a distribution
that declares neither. Its doc comment already said it omits zero values.
cmd/builder: 2 packages ok, 0 failures. confmap, service, otelcol, confighttp,
exporterhelper and receiver all build.
38 lines
1.3 KiB
Go
38 lines
1.3 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package xconfmap // import "go.opentelemetry.io/collector/confmap/xconfmap"
|
|
|
|
import (
|
|
"go.opentelemetry.io/collector/confmap"
|
|
"go.opentelemetry.io/collector/confmap/internal"
|
|
)
|
|
|
|
// Validator defines an optional interface for configurations to implement to do validation.
|
|
//
|
|
// Deprecated [v0.152.0]: Use `confmap.Validator“ instead.
|
|
type Validator = internal.Validator
|
|
|
|
// Validate validates a config, by doing this:
|
|
// - Call Validate on the config itself if the config implements ConfigValidator.
|
|
//
|
|
// Deprecated [v0.152.0]: Use `confmap.Validate“ instead.
|
|
func Validate(cfg any) error {
|
|
return internal.Validate(cfg)
|
|
}
|
|
|
|
// WithForceUnmarshaler sets an option to run a top-level Unmarshal method,
|
|
// even if the Conf being unmarshaled is already a parameter from an Unmarshal method.
|
|
// To avoid infinite recursion, this should only be used when unmarshaling into
|
|
// a different type from the current Unmarshaler.
|
|
// For instance, this should be used in wrapper types such as configoptional.Optional
|
|
// to ensure the inner type's Unmarshal method is called.
|
|
func WithForceUnmarshaler() confmap.UnmarshalOption {
|
|
return internal.WithForceUnmarshaler()
|
|
}
|
|
|
|
// WithUnredacted marshals opaque strings unredacted.
|
|
func WithUnredacted() confmap.MarshalOption {
|
|
return internal.WithUnredacted()
|
|
}
|