Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zap log bridge #5191

Open
pellared opened this issue Mar 1, 2024 · 3 comments
Open

Add zap log bridge #5191

pellared opened this issue Mar 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@pellared
Copy link
Member

pellared commented Mar 1, 2024

Add zapcore.Core log bridge.

@pellared
Copy link
Member Author

@khushijain21 is working on it.

@khushijain21
Copy link
Contributor

khushijain21 commented May 7, 2024

Outline of the approach

  • Skeleteon of zapcore and config for the bridge
  • Implement Enabled, Check method
  • Implement zapcore encoder
  • Implement With and Write method
  • Add Benchmarks

@pellared
Copy link
Member Author

pellared commented May 7, 2024

  1. We do not need to implement zapcore.Encoder as we are providing a zapcore.Core
  2. You can first implement Write and then With method as separate PRs
  3. You can handle https://pkg.go.dev/go.uber.org/zap/zapcore#NamespaceType as a separate PR
  4. You can handle trace correlation (handling context.Context) as a separate PR
  5. After benchmarks are in place we can add performance improvements. I suggests adding usage of sync.Pool and other improvements after benchmarks are in place and we have required functionality in place.
  6. Go doc comment should be updated after the implementation is done.
  7. A testable example should be added demonstrating how to setup otelzap.
  8. After the release the Go module should be added to https://opentelemetry.io/ecosystem/registry
  9. After the release we could document the bridge also in https://opentelemetry.io/docs/languages/go/

pellared pushed a commit that referenced this issue May 17, 2024
Part of #5191
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue May 17, 2024
Part of #5191
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
MrAlias added a commit that referenced this issue May 18, 2024
Part of
#5191
and #5586

Pre-work
#5279

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
pellared added a commit that referenced this issue May 20, 2024
Part of #5191

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
zailic pushed a commit to zailic/opentelemetry-go-contrib that referenced this issue May 20, 2024
Part of open-telemetry#5191
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
zailic pushed a commit to zailic/opentelemetry-go-contrib that referenced this issue May 20, 2024
Part of open-telemetry#5191
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
zailic pushed a commit to zailic/opentelemetry-go-contrib that referenced this issue May 20, 2024
Part of
open-telemetry#5191
and open-telemetry#5586

Pre-work
open-telemetry#5279

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
zailic pushed a commit to zailic/opentelemetry-go-contrib that referenced this issue May 20, 2024
Part of open-telemetry#5191

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared added a commit that referenced this issue May 21, 2024
Part of
#5191

Pre-work
#5279

This PR implements `uInt` methods `objectEncoder`

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue May 21, 2024
Part of
#5191

Pre-work
#5279

This PR adds skeleton for arrayEncoder
khushijain21 added a commit to khushijain21/opentelemetry-go-contrib that referenced this issue May 22, 2024
Part of
open-telemetry#5191

Pre-work
open-telemetry#5279

This PR implements `uInt` methods `objectEncoder`

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared added a commit that referenced this issue May 31, 2024
Part of
#5191

Pre-work
#5279

This PR implements `With` method

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue May 31, 2024
pellared added a commit that referenced this issue Jun 4, 2024
Part of
#5191

Pre-work
#5279

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared added a commit that referenced this issue Jun 5, 2024
Part of
#5191

Pre-work
#5279

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared added a commit that referenced this issue Jun 19, 2024
Part of
#5191

Pre-work
#5279

The approach is to use linked list to open a namespace and keep track of
it.
`calculate` method iterates to the most nested namespace and appends
data in reverse order.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
pellared pushed a commit that referenced this issue Jun 25, 2024
Towards #5191

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
pellared added a commit that referenced this issue Jun 26, 2024
Part of #5191

Pre-work #5279

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/contrib/bridges/otelzap
cpu: 12th Gen Intel(R) Core(TM) i5-1245U
BenchmarkCoreWrite/10_fields-12         	 1000000	      1116 ns/op	     978 B/op	      13 allocs/op
BenchmarkCoreWrite/20_fields-12         	  407290	      2615 ns/op	    2180 B/op	      22 allocs/op
BenchmarkCoreWrite/Namespace-12         	  725268	      1671 ns/op	    1760 B/op	      16 allocs/op
BenchmarkCoreWrite/With10_fields-12     	 4964038	       260.2 ns/op	     208 B/op	       1 allocs/op
BenchmarkCoreWrite/With20_fields-12     	 2004085	       628.7 ns/op	     640 B/op	       1 allocs/op
BenchmarkCoreWrite/WithNamespace-12     	100000000	        16.95 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	go.opentelemetry.io/contrib/bridges/otelzap	8.619s
```

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 26, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
This commit adds a simple example to demonstrate how to use the OpenTelemetry Zap bridge to send logs emitted by Zap to an OTEL endpoint.

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
thomasgouveia added a commit to thomasgouveia/opentelemetry-go-contrib that referenced this issue Jun 27, 2024
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

2 participants