[chore] update dependencies (#4196)

- go.opentelemetry.io/contrib/exporters/autoexport v0.60.0 -> v0.61.0
- go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0 -> v0.61.0

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4196
Co-authored-by: kim <grufwub@gmail.com>
Co-committed-by: kim <grufwub@gmail.com>
This commit is contained in:
kim 2025-05-26 16:13:55 +02:00 committed by tobi
commit 143febb318
152 changed files with 2635 additions and 1688 deletions

View file

@ -156,13 +156,20 @@ func (b *BatchProcessor) poll(interval time.Duration) (done chan struct{}) {
global.Warn("dropped log records", "dropped", d)
}
qLen := b.q.TryDequeue(buf, func(r []Record) bool {
ok := b.exporter.EnqueueExport(r)
if ok {
buf = slices.Clone(buf)
}
return ok
})
var qLen int
// Don't copy data from queue unless exporter can accept more, it is very expensive.
if b.exporter.Ready() {
qLen = b.q.TryDequeue(buf, func(r []Record) bool {
ok := b.exporter.EnqueueExport(r)
if ok {
buf = slices.Clone(buf)
}
return ok
})
} else {
qLen = b.q.Len()
}
if qLen >= b.batchSize {
// There is another full batch ready. Immediately trigger
// another export attempt.
@ -272,6 +279,13 @@ func newQueue(size int) *queue {
}
}
func (q *queue) Len() int {
q.Lock()
defer q.Unlock()
return q.len
}
// Dropped returns the number of Records dropped during enqueueing since the
// last time Dropped was called.
func (q *queue) Dropped() uint64 {

View file

@ -31,6 +31,6 @@ is being run on. That way when multiple instances of the code are collected
at a single endpoint their origin is decipherable.
See [go.opentelemetry.io/otel/log] for more information about
the OpenTelemetry Logs Bridge API.
the OpenTelemetry Logs API.
*/
package log // import "go.opentelemetry.io/otel/sdk/log"

View file

@ -186,11 +186,10 @@ type bufferExporter struct {
// newBufferExporter returns a new bufferExporter that wraps exporter. The
// returned bufferExporter will buffer at most size number of export requests.
// If size is less than zero, zero will be used (i.e. only synchronous
// exporting will be supported).
// If size is less than 1, 1 will be used.
func newBufferExporter(exporter Exporter, size int) *bufferExporter {
if size < 0 {
size = 0
if size < 1 {
size = 1
}
input := make(chan exportData, size)
return &bufferExporter{
@ -201,6 +200,10 @@ func newBufferExporter(exporter Exporter, size int) *bufferExporter {
}
}
func (e *bufferExporter) Ready() bool {
return len(e.input) != cap(e.input)
}
var errStopped = errors.New("exporter stopped")
func (e *bufferExporter) enqueue(ctx context.Context, records []Record, rCh chan<- error) error {

View file

@ -8,7 +8,6 @@ import (
"go.opentelemetry.io/otel/log"
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/resource"
)
// FilterProcessor is a [Processor] that knows, and can identify, what [Record]
@ -56,7 +55,6 @@ type FilterProcessor interface {
// EnabledParameters represents payload for [FilterProcessor]'s Enabled method.
type EnabledParameters struct {
Resource resource.Resource
InstrumentationScope instrumentation.Scope
Severity log.Severity
}

View file

@ -50,7 +50,6 @@ func (l *logger) Emit(ctx context.Context, r log.Record) {
// returned if it can be positively verified that no Processor will process.
func (l *logger) Enabled(ctx context.Context, param log.EnabledParameters) bool {
p := EnabledParameters{
Resource: *l.provider.resource,
InstrumentationScope: l.instrumentationScope,
Severity: param.Severity,
}

View file

@ -236,7 +236,7 @@ func WithAttributeCountLimit(limit int) LoggerProviderOption {
})
}
// AttributeValueLengthLimit sets the maximum allowed attribute value length.
// WithAttributeValueLengthLimit sets the maximum allowed attribute value length.
//
// This limit only applies to string and string slice attribute values.
// Any string longer than this value will be truncated to this length.