mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
#### Description Embed `confignet.AddrConfig` in `confighttp.ServerConfig`, replacing the `Endpoint` field. This introduces the "transport" config attribute, which can be set to "unix" for binding a Unix domain socket. #### Link to tracking issue Fixes #8752 Fixes #14187 #### Testing ```bash $ ./bin/otelcorecol_linux_amd64 \ --config examples/local/otel-config.yaml \ --set receivers::otlp::protocols::http::transport=unix \ --set receivers::otlp::protocols::http::endpoint=\"@otlphttp\" ``` ```bash $ curl --abstract-unix-socket otlphttp http://testing.invalid:1234/v1/traces 405 method not allowed, supported: [POST] ``` #### Documentation Updated README.md --------- Co-authored-by: Antoine Toulme <[email protected]>
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package zpagesextension // import "go.opentelemetry.io/collector/extension/zpagesextension"
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"go.opentelemetry.io/collector/component"
|
|
"go.opentelemetry.io/collector/config/confighttp"
|
|
)
|
|
|
|
// Config has the configuration for the extension enabling the zPages extension.
|
|
type Config struct {
|
|
confighttp.ServerConfig `mapstructure:",squash"`
|
|
|
|
Expvar ExpvarConfig `mapstructure:"expvar"`
|
|
// prevent unkeyed literal initialization
|
|
_ struct{}
|
|
}
|
|
|
|
// ExpvarConfig has the configuration for the expvar service.
|
|
type ExpvarConfig struct {
|
|
// Enabled indicates whether to enable expvar service.
|
|
// (default = false)
|
|
Enabled bool `mapstructure:"enabled"`
|
|
// prevent unkeyed literal initialization
|
|
_ struct{}
|
|
}
|
|
|
|
var _ component.Config = (*Config)(nil)
|
|
|
|
// Validate checks if the extension configuration is valid
|
|
func (cfg *Config) Validate() error {
|
|
if cfg.NetAddr.Endpoint == "" {
|
|
return errors.New("\"endpoint\" is required when using the \"zpages\" extension")
|
|
}
|
|
return nil
|
|
}
|