-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
Copy pathconfig.go
37 lines (28 loc) · 1.22 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package zipkinexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter"
import (
"errors"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/confighttp"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
// Config defines configuration settings for the Zipkin exporter.
type Config struct {
QueueSettings exporterhelper.QueueConfig `mapstructure:"sending_queue"`
configretry.BackOffConfig `mapstructure:"retry_on_failure"`
// Configures the exporter client.
// The Endpoint to send the Zipkin trace data to (e.g.: http://some.url:9411/api/v2/spans).
confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
Format string `mapstructure:"format"`
DefaultServiceName string `mapstructure:"default_service_name"`
}
var _ component.Config = (*Config)(nil)
// Validate checks if the exporter configuration is valid
func (cfg *Config) Validate() error {
if cfg.ClientConfig.Endpoint == "" {
return errors.New("endpoint required")
}
return nil
}