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

Improve telemetry.Settings #6275

Merged
merged 19 commits into from
Nov 29, 2024
Merged

Improve telemetry.Settings #6275

merged 19 commits into from
Nov 29, 2024

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Nov 29, 2024

Which problem is this PR solving?

Description of the changes

  • Rename telemetry.Setting to telemetry.Settings
  • Create helpers NoopSettings() and FromOtelComponent()
  • Remove LeveledMeterProvider which is deprecated in OTEL
  • Use telset in more places
  • Pull out Initialize() from storage.Factory

How was this change tested?

  • CI

Checklist

yurishkuro and others added 14 commits November 28, 2024 13:46
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 89.65517% with 9 lines in your changes missing coverage. Please review.

Project coverage is 96.44%. Comparing base (76593a6) to head (5bc515e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/query/app/server.go 76.00% 6 Missing ⚠️
...md/jaeger/internal/extension/jaegerquery/server.go 86.36% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6275      +/-   ##
==========================================
+ Coverage   96.41%   96.44%   +0.03%     
==========================================
  Files         355      355              
  Lines       20152    20165      +13     
==========================================
+ Hits        19430    19449      +19     
+ Misses        532      528       -4     
+ Partials      190      188       -2     
Flag Coverage Δ
badger_v1 8.22% <0.00%> (-0.10%) ⬇️
badger_v2 1.67% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 14.22% <0.00%> (-0.17%) ⬇️
cassandra-4.x-v2 1.61% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1 14.22% <0.00%> (-0.17%) ⬇️
cassandra-5.x-v2 1.61% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 18.39% <0.00%> (-0.22%) ⬇️
elasticsearch-7.x-v1 18.47% <0.00%> (-0.21%) ⬇️
elasticsearch-8.x-v1 18.63% <0.00%> (-0.22%) ⬇️
elasticsearch-8.x-v2 1.67% <0.00%> (-0.01%) ⬇️
grpc_v1 9.41% <59.37%> (-0.03%) ⬇️
grpc_v2 7.04% <30.76%> (+0.05%) ⬆️
kafka-v1 8.77% <0.00%> (-0.11%) ⬇️
kafka-v2 1.67% <0.00%> (-0.01%) ⬇️
memory_v2 1.67% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 18.52% <0.00%> (-0.22%) ⬇️
opensearch-2.x-v1 18.52% <0.00%> (-0.22%) ⬇️
opensearch-2.x-v2 1.66% <0.00%> (-0.02%) ⬇️
tailsampling-processor 0.46% <0.00%> (-0.01%) ⬇️
unittests 95.36% <89.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro changed the title Telset Improve telemetry.Settings Nov 29, 2024
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro marked this pull request as ready for review November 29, 2024 02:30
@yurishkuro yurishkuro requested a review from a team as a code owner November 29, 2024 02:30
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some nits / questions

cmd/all-in-one/main.go Outdated Show resolved Hide resolved
Comment on lines -167 to -168
LeveledMeterProvider: func(_ configtelemetry.Level) metric.MeterProvider {
return noop.NewMeterProvider()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be replaced with a meter provider? or do we not need to pass anything here because its noop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added noop to L100, but afaik we don't have a way to go from internal metrics.Factory to OTEL API. We would need to extend the Service (cmd/internal/flags) to initialize OTEL SDK. Main reason I didn't push for that before is that OTEL SDK performance sucks compared to Prometheus SDK, since OTEL does not support bound instrument and we're using them everywhere.

crossdock/main.go Show resolved Hide resolved
assert.NotNil(t, telset.TracerProvider)
assert.NotNil(t, telset.ReportStatus)
assert.NotNil(t, telset.Host)
telset.ReportStatus(componentstatus.NewFatalErrorEvent(errors.New("foobar")))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do we need this for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean in this test or in general? In this test it's just to exercise the code in the lambda. In general, the idea is to allow internal components to report status. We had some of it with healthcheck object, but it's not very comprehensive today.

storage/factory.go Outdated Show resolved Hide resolved
@@ -18,25 +18,30 @@ import (
"github.com/jaegertracing/jaeger/storage/spanstore"
)

// Same as Factory, but without the Initialize method.
// It was a design mistake originally to add Initialize to the Factory interface.
type BaseFactory interface {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a longer term plan to get rid of Factory and replace it with this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it's worth it for v1. We should make sure v2 API is not repeating the same mistake.

Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro merged commit cedaeaa into jaegertracing:main Nov 29, 2024
51 of 52 checks passed
@yurishkuro yurishkuro deleted the telset branch November 29, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants