forked from open-telemetry/opentelemetry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
152 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// 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 Exporter's methods may be called concurrently with itself | ||
// or with other methods. It is the responsibility of the Exporter to manage | ||
// this concurrency. | ||
type Processor interface { | ||
// DO NOT CHANGE: any modification will not be backwards compatible and | ||
// must never be done outside of a new major release. | ||
|
||
// OnEmit is called when a Record is emitted. | ||
// | ||
// The deadline or cancellation of the passed context must be honored. An | ||
// appropriate error should be returned in these situations. | ||
// | ||
// 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. | ||
// | ||
// Before modifying a Record, the implementation must use Record.Clone | ||
// to create a copy that shares no state with the original. | ||
OnEmit(ctx context.Context, record Record) error | ||
// DO NOT CHANGE: any modification will not be backwards compatible and | ||
// must never be done outside of a new major release. | ||
|
||
// 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 | ||
// DO NOT CHANGE: any modification will not be backwards compatible and | ||
// must never be done outside of a new major release. | ||
|
||
// 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 | ||
// DO NOT CHANGE: any modification will not be backwards compatible and | ||
// must never be done outside of a new major release. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.