forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.go
27 lines (21 loc) · 937 Bytes
/
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
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package googlecloudexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter"
import (
"fmt"
"github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
// Config defines configuration for Google Cloud exporter.
type Config struct {
collector.Config `mapstructure:",squash"`
// Timeout for all API calls. If not set, defaults to 12 seconds.
exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
}
func (cfg *Config) Validate() error {
if err := collector.ValidateConfig(cfg.Config); err != nil {
return fmt.Errorf("googlecloud exporter settings are invalid :%w", err)
}
return nil
}