Skip to content

Commit

Permalink
Apply PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
antonjim-te committed Jul 27, 2023
1 parent 5295e11 commit 9534fbb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions exporter/exporterhelper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The following configuration options can be modified:
[the batch processor](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor)
is used, the metric `batch_send_size` can be used for estimation)
- `timeout` (default = 5s): Time to wait per individual attempt to send data to a backend
- `sampled_logger`: Enables/disables sampling of logging messages, which caps the CPU and I/O load of logging while keeping a representative subset of your logs.
- `enabled` (default = true)
- `sampled_logger`: Enables/disables sampling of logging messages.
- `enabled` (default = true). When setting `debug` log level the sampling will be disabled regardless of the value of this property.

The `initial_interval`, `max_interval`, `max_elapsed_time`, and `timeout` options accept
[duration strings](https://pkg.go.dev/time#ParseDuration),
Expand Down
5 changes: 2 additions & 3 deletions exporter/exporterhelper/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ func NewDefaultTimeoutSettings() TimeoutSettings {
}
}

// SampledLoggerSettings configures the logger sampler, which caps the CPU and I/O load of logging while keeping a representative subset of your logs.
// Its purpose is to balance between the need for comprehensive logging and the potential performance impact of logging too much data.
// SampledLoggerSettings configures the logger sampler.
type SampledLoggerSettings struct {
// Enable/disable the sampledLogger
// Enable/disable the sampledLogger. When setting `debug` log level the sampling will be disabled regardless of the value of this property.
Enabled bool `mapstructure:"enabled"`
}

Expand Down
9 changes: 4 additions & 5 deletions exporter/otlpexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ import (

// Config defines configuration for OTLP exporter.
type Config struct {
exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`

configgrpc.GRPCClientSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
exporterhelper.SampledLoggerSettings `mapstructure:"sampled_logger"`
configgrpc.GRPCClientSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
}

var _ component.Config = (*Config)(nil)
Expand Down
4 changes: 2 additions & 2 deletions exporter/otlphttpexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The following settings can be optionally configured:
- `timeout` (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client
- `read_buffer_size` (default = 0): ReadBufferSize for HTTP client.
- `write_buffer_size` (default = 512 * 1024): WriteBufferSize for HTTP client.
- `sampled_logger`: Enables/disables sampling of logging messages, which caps the CPU and I/O load of logging while keeping a representative subset of your logs.
- `enabled` (default = true)
- `sampled_logger`: Enables/disables sampling of logging messages.
- `enabled` (default = true). When setting `debug` log level the sampling will be disabled regardless of the value of this property.

Example:

Expand Down
9 changes: 4 additions & 5 deletions exporter/otlphttpexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import (

// Config defines configuration for OTLP/HTTP exporter.
type Config struct {
confighttp.HTTPClientSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
confighttp.HTTPClientSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
exporterhelper.QueueSettings `mapstructure:"sending_queue"`
exporterhelper.RetrySettings `mapstructure:"retry_on_failure"`
exporterhelper.SampledLoggerSettings `mapstructure:"sampled_logger"`

// The URL to send traces to. If omitted the Endpoint + "/v1/traces" will be used.
TracesEndpoint string `mapstructure:"traces_endpoint"`
Expand All @@ -25,8 +26,6 @@ type Config struct {

// The URL to send logs to. If omitted the Endpoint + "/v1/logs" will be used.
LogsEndpoint string `mapstructure:"logs_endpoint"`

exporterhelper.SampledLoggerSettings `mapstructure:"sampled_logger"`
}

var _ component.Config = (*Config)(nil)
Expand Down

0 comments on commit 9534fbb

Please sign in to comment.