From 43492f516185abad764f09c61b2143259e711973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 10 May 2024 13:46:27 +0200 Subject: [PATCH 1/2] sdk/log: Document how Processor and Exporter interfaces can be extended --- CONTRIBUTING.md | 3 +++ sdk/log/DESIGN.md | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6aed3bd9d1d..2176ce5261b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -570,6 +570,9 @@ functionality should be added, each one will need their own super-set interfaces and will duplicate the pattern. For this reason, the simple targeted interface that defines the specific functionality should be preferred. +See also: +[Keeping Your Modules Compatible: Working with interfaces](https://go.dev/blog/module-compatibility#working-with-interfaces). + ### Testing The tests should never leak goroutines. diff --git a/sdk/log/DESIGN.md b/sdk/log/DESIGN.md index b1a69aae9ba..9cd63ea897c 100644 --- a/sdk/log/DESIGN.md +++ b/sdk/log/DESIGN.md @@ -50,6 +50,10 @@ The user set processors for the `LoggerProvider` using The user can configure custom processors and decorate built-in processors. +The specification may add new operations to `Processor`. +[CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) +describes how the SDK can be extended in a backwards-compatible way. + ### SimpleProcessor The [Simple processor](https://opentelemetry.io/docs/specs/otel/logs/sdk/#simple-processor) @@ -74,6 +78,10 @@ so that the caller can reuse the passed slice (e.g. using [`sync.Pool`](https://pkg.go.dev/sync#Pool)) to avoid heap allocations on each call. +The specification may add new operations to `Exporter`. +[CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) +describes how the SDK can be extended in a backwards-compatible way. + ### Record The [ReadWriteLogRecord](https://opentelemetry.io/docs/specs/otel/logs/sdk/#readwritelogrecord) From ae195bdcdc3dbe1191a03399f26d8eed7a945639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Fri, 10 May 2024 13:48:42 +0200 Subject: [PATCH 2/2] Refine --- sdk/log/DESIGN.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/log/DESIGN.md b/sdk/log/DESIGN.md index 9cd63ea897c..99c5bf51c32 100644 --- a/sdk/log/DESIGN.md +++ b/sdk/log/DESIGN.md @@ -50,8 +50,9 @@ The user set processors for the `LoggerProvider` using The user can configure custom processors and decorate built-in processors. -The specification may add new operations to `Processor`. -[CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) +The specification may add new operations to the +[LogRecordProcessor](https://opentelemetry.io/docs/specs/otel/logs/sdk/#logrecordprocessor). +If it happens, [CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) describes how the SDK can be extended in a backwards-compatible way. ### SimpleProcessor @@ -78,8 +79,9 @@ so that the caller can reuse the passed slice (e.g. using [`sync.Pool`](https://pkg.go.dev/sync#Pool)) to avoid heap allocations on each call. -The specification may add new operations to `Exporter`. -[CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) +The specification may add new operations to the +[LogRecordExporter](https://opentelemetry.io/docs/specs/otel/logs/sdk/#logrecordexporter). +If it happens, [CONTRIBUTING.md](../../CONTRIBUTING.md#how-to-change-other-interfaces) describes how the SDK can be extended in a backwards-compatible way. ### Record