feat(inputs.opentelemetry): Add option to set max receive message size (#15231)
This commit is contained in:
parent
7f83b7aae9
commit
7ed0364b34
|
|
@ -35,6 +35,9 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
|
||||||
## Override the default (5s) new connection timeout
|
## Override the default (5s) new connection timeout
|
||||||
# timeout = "5s"
|
# timeout = "5s"
|
||||||
|
|
||||||
|
## gRPC Maximum Message Size
|
||||||
|
# max_msg_size = "4MB"
|
||||||
|
|
||||||
## Override the default span attributes to be used as line protocol tags.
|
## Override the default span attributes to be used as line protocol tags.
|
||||||
## These are always included as tags:
|
## These are always included as tags:
|
||||||
## - trace ID
|
## - trace ID
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,11 @@ type OpenTelemetry struct {
|
||||||
SpanDimensions []string `toml:"span_dimensions"`
|
SpanDimensions []string `toml:"span_dimensions"`
|
||||||
LogRecordDimensions []string `toml:"log_record_dimensions"`
|
LogRecordDimensions []string `toml:"log_record_dimensions"`
|
||||||
MetricsSchema string `toml:"metrics_schema"`
|
MetricsSchema string `toml:"metrics_schema"`
|
||||||
|
MaxMsgSize config.Size `toml:"max_msg_size"`
|
||||||
|
Timeout config.Duration `toml:"timeout"`
|
||||||
|
Log telegraf.Logger `toml:"-"`
|
||||||
|
|
||||||
tls.ServerConfig
|
tls.ServerConfig
|
||||||
Timeout config.Duration `toml:"timeout"`
|
|
||||||
|
|
||||||
Log telegraf.Logger `toml:"-"`
|
|
||||||
|
|
||||||
listener net.Listener // overridden in tests
|
listener net.Listener // overridden in tests
|
||||||
grpcServer *grpc.Server
|
grpcServer *grpc.Server
|
||||||
|
|
@ -59,6 +59,9 @@ func (o *OpenTelemetry) Start(accumulator telegraf.Accumulator) error {
|
||||||
if o.Timeout > 0 {
|
if o.Timeout > 0 {
|
||||||
grpcOptions = append(grpcOptions, grpc.ConnectionTimeout(time.Duration(o.Timeout)))
|
grpcOptions = append(grpcOptions, grpc.ConnectionTimeout(time.Duration(o.Timeout)))
|
||||||
}
|
}
|
||||||
|
if o.MaxMsgSize > 0 {
|
||||||
|
grpcOptions = append(grpcOptions, grpc.MaxRecvMsgSize(int(o.MaxMsgSize)))
|
||||||
|
}
|
||||||
|
|
||||||
logger := &otelLogger{o.Log}
|
logger := &otelLogger{o.Log}
|
||||||
influxWriter := &writeToAccumulator{accumulator}
|
influxWriter := &writeToAccumulator{accumulator}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@
|
||||||
## Override the default (5s) new connection timeout
|
## Override the default (5s) new connection timeout
|
||||||
# timeout = "5s"
|
# timeout = "5s"
|
||||||
|
|
||||||
|
## gRPC Maximum Message Size
|
||||||
|
# max_msg_size = "4MB"
|
||||||
|
|
||||||
## Override the default span attributes to be used as line protocol tags.
|
## Override the default span attributes to be used as line protocol tags.
|
||||||
## These are always included as tags:
|
## These are always included as tags:
|
||||||
## - trace ID
|
## - trace ID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue