mirror of
https://github.com/distribution/distribution.git
synced 2025-09-27 07:03:15 +00:00
Upgrade go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
Signed-off-by: krynju <krystian.gulinski@juliahub.com>
This commit is contained in:
21
vendor/go.opentelemetry.io/otel/sdk/log/batch.go
generated
vendored
21
vendor/go.opentelemetry.io/otel/sdk/log/batch.go
generated
vendored
@@ -19,6 +19,7 @@ const (
|
||||
dfltExpInterval = time.Second
|
||||
dfltExpTimeout = 30 * time.Second
|
||||
dfltExpMaxBatchSize = 512
|
||||
dfltExpBufferSize = 1
|
||||
|
||||
envarMaxQSize = "OTEL_BLRP_MAX_QUEUE_SIZE"
|
||||
envarExpInterval = "OTEL_BLRP_SCHEDULE_DELAY"
|
||||
@@ -119,8 +120,7 @@ func NewBatchProcessor(exporter Exporter, opts ...BatchProcessorOption) *BatchPr
|
||||
exporter = newChunkExporter(exporter, cfg.expMaxBatchSize.Value)
|
||||
|
||||
b := &BatchProcessor{
|
||||
// TODO: explore making the size of this configurable.
|
||||
exporter: newBufferExporter(exporter, 1),
|
||||
exporter: newBufferExporter(exporter, cfg.expBufferSize.Value),
|
||||
|
||||
q: newQueue(cfg.maxQSize.Value),
|
||||
batchSize: cfg.expMaxBatchSize.Value,
|
||||
@@ -349,6 +349,7 @@ type batchConfig struct {
|
||||
expInterval setting[time.Duration]
|
||||
expTimeout setting[time.Duration]
|
||||
expMaxBatchSize setting[int]
|
||||
expBufferSize setting[int]
|
||||
}
|
||||
|
||||
func newBatchConfig(options []BatchProcessorOption) batchConfig {
|
||||
@@ -382,6 +383,10 @@ func newBatchConfig(options []BatchProcessorOption) batchConfig {
|
||||
clampMax[int](c.maxQSize.Value),
|
||||
fallback[int](dfltExpMaxBatchSize),
|
||||
)
|
||||
c.expBufferSize = c.expBufferSize.Resolve(
|
||||
clearLessThanOne[int](),
|
||||
fallback[int](dfltExpBufferSize),
|
||||
)
|
||||
|
||||
return c
|
||||
}
|
||||
@@ -458,3 +463,15 @@ func WithExportMaxBatchSize(size int) BatchProcessorOption {
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
||||
// WithExportBufferSize sets the batch buffer size.
|
||||
// Batches will be temporarily kept in a memory buffer until they are exported.
|
||||
//
|
||||
// By default, a value of 1 will be used.
|
||||
// The default value is also used when the provided value is less than one.
|
||||
func WithExportBufferSize(size int) BatchProcessorOption {
|
||||
return batchOptionFunc(func(cfg batchConfig) batchConfig {
|
||||
cfg.expBufferSize = newSetting(size)
|
||||
return cfg
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user