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 Beholder sdk #694

Merged
merged 53 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
53d9e40
Add Beholder sdk
cll-gg Aug 2, 2024
d2b8e22
Beholder: update comment
pkcll Aug 12, 2024
5450f88
Beholder: rename variable
pkcll Aug 12, 2024
10707bd
Beholder: add Close function to global
pkcll Aug 12, 2024
656550b
Beholder: export OtelClient struct
pkcll Aug 12, 2024
43b5945
Beholder: rename pb test message
pkcll Aug 12, 2024
14b67f1
Beholder: extract logic to set OTel globals from OtelClient constructor
pkcll Aug 13, 2024
ec50c05
Beholder: make OtelClient.Emit variadic
pkcll Aug 13, 2024
c29bb1a
Beholder: fix test
pkcll Aug 13, 2024
ace292d
Merge branch 'main' of github.com:smartcontractkit/chainlink-common i…
pkcll Aug 13, 2024
de71480
Fix test
pkcll Aug 13, 2024
b8f6c6f
Beholder: change config.ResourceAttributes type
pkcll Aug 13, 2024
15d4beb
Beholder: improve test for Message attributes
pkcll Aug 13, 2024
b99d439
Beholder: remove Exporter field from messageEmitter
pkcll Aug 13, 2024
b80e230
Beholder: add onClose callback to shutdown providers
pkcll Aug 13, 2024
96027a3
Beholder: use tests.Context(t)
pkcll Aug 13, 2024
84357e5
Beholder: OtelAttr print unhandled value
pkcll Aug 13, 2024
160a7d8
Beholder: update global.Emit
pkcll Aug 14, 2024
e48eaed
Beholder: add NewMessage constructor to global
pkcll Aug 14, 2024
51a50c6
Beholder: update example_test
pkcll Aug 16, 2024
b69b21e
Beholder: Add ForPackage method to OtelClient, remove PackageName fie…
pkcll Aug 16, 2024
1392fd2
Beholder: remove EmitMessage method
pkcll Aug 16, 2024
edb1e11
Rename config field
pkcll Aug 16, 2024
bdc0025
Beholder: pass emitter struct by value to OtelClient
pkcll Aug 19, 2024
0e3f587
Beholder: add test for noop otel client
pkcll Aug 19, 2024
cd6f5a8
Beholder: remove SdkOtelRecord
pkcll Aug 19, 2024
adcbefa
Beholder: refactor AddAttributes to take list of KV attributes
pkcll Aug 19, 2024
d0a857a
Beholder: pass context through the example
pkcll Aug 19, 2024
2e9c6c1
Beholder: fix typos
pkcll Aug 19, 2024
c8e8291
Beholder: use simple log processor in tests
pkcll Aug 20, 2024
faa61c2
Beholder: move SetGlobals to global package
pkcll Aug 20, 2024
04607fa
Merge branch 'main' of github.com:smartcontractkit/chainlink-common i…
pkcll Aug 21, 2024
4e80921
Beholder: make message Attributes to be an alias of map
pkcll Aug 21, 2024
99140c8
Beholder: remove code not related to setting globals from 'global' pa…
pkcll Aug 21, 2024
7154f0d
Beholder: add example when beholder client is not initialized and noo…
pkcll Aug 22, 2024
87e46ae
update go.mod
pkcll Aug 22, 2024
11c86c5
Beholder: add context to NewOtelClient
pkcll Aug 22, 2024
555b582
Beholder: move global to beholder package
pkcll Aug 22, 2024
e749bb1
Beholder: revert renaming of Emitter interface
pkcll Aug 23, 2024
1582cc2
Beholder: remove Client interface, rename OtelClient struct
pkcll Aug 23, 2024
ebf2a1e
Beholder: rename Otel Client references
pkcll Aug 23, 2024
4ebb5fc
Beholder: handle errors in NewStdoutClient
pkcll Aug 23, 2024
7785057
Beholder: return pointer from Client constructors
pkcll Aug 23, 2024
26c09d7
Beholder: remove errorHandler parameter from NewClient
pkcll Aug 23, 2024
8cd246d
Merge branch 'main' of github.com:smartcontractkit/chainlink-common i…
pkcll Aug 23, 2024
f2b74d4
Fix test
pkcll Aug 23, 2024
0d12d2c
Beholder: update example test to pass golangci-lint
pkcll Aug 23, 2024
fc72e2e
go mod tidy
pkcll Aug 23, 2024
64f6e21
Beholder: delete SetOtelErrorHandler, use otel.SetErrorHandler instead
pkcll Aug 26, 2024
fa6cec4
Beholder: prefix global getters with 'Get*'
pkcll Aug 26, 2024
3504324
Beholder: remove StdoutClientOption, rename NewStdoutClient to NewWri…
pkcll Aug 27, 2024
2187c01
Beholder: make writerClientConfig not exported
pkcll Aug 27, 2024
18e86d0
Merge branch 'main' into beholder-sdk
pkcll Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
pkcll committed Aug 13, 2024
commit de7148038e71eabc589fd59dd126c6c1e441da14
14 changes: 2 additions & 12 deletions pkg/beholder/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,9 @@ func TestClient_Close(t *testing.T) {
exporterMock := mocks.NewOTLPExporter(t)
defer exporterMock.AssertExpectations(t)

otelErrorHandler := func(err error) {}
// Override exporter factory which is used by Client
exporterFactory := func(context.Context, ...otlploggrpc.Option) (sdklog.Exporter, error) {
return exporterMock, nil
}
client, err := newOtelClient(DefaultConfig(), otelErrorHandler, exporterFactory)
if err != nil {
t.Fatalf("Error creating beholder client: %v", err)
}

exporterMock.On("Shutdown", mock.Anything).Return(nil).Once()
client := NewStdoutClient()

err = client.Close()
err := client.Close()
assert.NoError(t, err)

exporterMock.AssertExpectations(t)
Expand Down
2 changes: 1 addition & 1 deletion pkg/beholder/pb/example.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading