/
config.go
29 lines (23 loc) · 897 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
28
29
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package remoteobserverprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/remoteobserverprocessor"
import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/confighttp"
"golang.org/x/time/rate"
)
const defaultEndpoint = ":12001"
type Config struct {
confighttp.HTTPServerSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
// Limit is a float that indicates the maximum number of messages repeated
// through the websocket by this processor in messages per second. Defaults to 1.
Limit rate.Limit `mapstructure:"limit"`
}
func createDefaultConfig() component.Config {
return &Config{
HTTPServerSettings: confighttp.HTTPServerSettings{
Endpoint: defaultEndpoint,
},
Limit: 1,
}
}