mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 09:07:28 -06:00
# Description This simplifies our OTEL setup by: * Getting rid of some deprecated things. * Using `autoexport` and letting things get configured by the `OTEL_` environment variables. * Removing all the unnecessary config options. ## Checklist Please put an x inside each checkbox to indicate that you've read and followed it: `[ ]` -> `[x]` If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want). - [x] I/we have read the [GoToSocial contribution guidelines](https://codeberg.org/superseriousbusiness/gotosocial/src/branch/main/CONTRIBUTING.md). - [x] I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat. - [x] I/we have not leveraged AI to create the proposed changes. - [x] I/we have performed a self-review of added code. - [x] I/we have written code that is legible and maintainable by others. - [ ] I/we have commented the added code, particularly in hard-to-understand areas. - [x] I/we have made any necessary changes to documentation. - [ ] I/we have added tests that cover new code. - [x] I/we have run tests and they pass locally with the changes. - [x] I/we have run `go fmt ./...` and `golangci-lint run`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4110 Reviewed-by: tobi <kipvandenbos@noreply.codeberg.org> Co-authored-by: Daenney <daenney@noreply.codeberg.org> Co-committed-by: Daenney <daenney@noreply.codeberg.org>
56 lines
2.2 KiB
Go
56 lines
2.2 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package log // import "go.opentelemetry.io/otel/sdk/log"
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// Processor handles the processing of log records.
|
|
//
|
|
// Any of the Processor's methods may be called concurrently with itself
|
|
// or with other methods. It is the responsibility of the Processor to manage
|
|
// this concurrency.
|
|
//
|
|
// See [FilterProcessor] for information about how a Processor can support filtering.
|
|
type Processor interface {
|
|
// OnEmit is called when a Record is emitted.
|
|
//
|
|
// OnEmit will be called independent of Enabled. Implementations need to
|
|
// validate the arguments themselves before processing.
|
|
//
|
|
// Implementation should not interrupt the record processing
|
|
// if the context is canceled.
|
|
//
|
|
// All retry logic must be contained in this function. The SDK does not
|
|
// implement any retry logic. All errors returned by this function are
|
|
// considered unrecoverable and will be reported to a configured error
|
|
// Handler.
|
|
//
|
|
// The SDK invokes the processors sequentially in the same order as
|
|
// they were registered using WithProcessor.
|
|
// Implementations may synchronously modify the record so that the changes
|
|
// are visible in the next registered processor.
|
|
// Notice that Record is not concurrent safe. Therefore, asynchronous
|
|
// processing may cause race conditions. Use Record.Clone
|
|
// to create a copy that shares no state with the original.
|
|
OnEmit(ctx context.Context, record *Record) error
|
|
|
|
// Shutdown is called when the SDK shuts down. Any cleanup or release of
|
|
// resources held by the exporter should be done in this call.
|
|
//
|
|
// The deadline or cancellation of the passed context must be honored. An
|
|
// appropriate error should be returned in these situations.
|
|
//
|
|
// After Shutdown is called, calls to Export, Shutdown, or ForceFlush
|
|
// should perform no operation and return nil error.
|
|
Shutdown(ctx context.Context) error
|
|
|
|
// ForceFlush exports log records to the configured Exporter that have not yet
|
|
// been exported.
|
|
//
|
|
// The deadline or cancellation of the passed context must be honored. An
|
|
// appropriate error should be returned in these situations.
|
|
ForceFlush(ctx context.Context) error
|
|
}
|