Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
antonjim-te committed Jul 26, 2023
1 parent 3192d88 commit 39f95e4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion exporter/exporterhelper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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`: Samples logging messages, which caps the CPU and I/O load of logging while keeping a representative subset of your logs.
- `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)

The `initial_interval`, `max_interval`, `max_elapsed_time`, and `timeout` options accept
Expand Down
4 changes: 2 additions & 2 deletions exporter/exporterhelper/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ func NewDefaultTimeoutSettings() TimeoutSettings {
}
}

// SampledLoggerSettings samples logging messages, which caps the CPU and I/O load of logging while keeping a
// SampledLoggerSettings Configure 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.
type SampledLoggerSettings struct {
// Enable the sampledLogger
// Enable/disable the sampledLogger
Enabled bool `mapstructure:"enabled"`
}

Expand Down
6 changes: 1 addition & 5 deletions exporter/exporterhelper/queued_retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,11 @@ func NewDefaultRetrySettings() RetrySettings {
}

func createSampledLogger(logger *zap.Logger, lCfg SampledLoggerSettings) *zap.Logger {
if logger.Core().Enabled(zapcore.DebugLevel) {
if !lCfg.Enabled || logger.Core().Enabled(zapcore.DebugLevel) {
// Debugging is enabled. Don't do any sampling.
return logger
}

if !lCfg.Enabled {
return logger
}

// Create a logger that samples all messages to 1 per 10 seconds initially,
// and 1/100 of messages after that.
opts := zap.WrapCore(func(core zapcore.Core) zapcore.Core {
Expand Down
2 changes: 1 addition & 1 deletion exporter/otlphttpexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ 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`: Samples logging messages, which caps the CPU and I/O load of logging while keeping a representative subset of your logs.
- `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)

Example:
Expand Down

0 comments on commit 39f95e4

Please sign in to comment.