-
Notifications
You must be signed in to change notification settings - Fork 77
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 OTel tracing bucket #61
Conversation
43dfc20
to
90f9ddf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this. Are you going to take care of fixing Thanos to make sure it doesn't loose instrumentation?
I'll make sure to do that. Maybe we can use opentracing tracing for the instrumented bucket? WDYT? |
860ea66
to
e16e78f
Compare
I think just replacing the spots where Thanos just called NewBucket, after this merges replace that with |
e16e78f
to
b3eeaf3
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Some comments, otherwise LGTM 👍🏽
client/factory.go
Outdated
return objstore.NewPrefixedBucket(bucket, bucketConf.Prefix), nil | ||
} | ||
|
||
// NewInstrumentedBucket initializes and returns new object storage clients. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true - it only wraps with metrics. Should we rather remove NewInstrumentedBucket
and keep objstore.BucketWithMetrics
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Fine by me, less is more :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not addressed.
client/factory.go
Outdated
|
||
// NewInstrumentedBucket initializes and returns new object storage clients. | ||
func NewInstrumentedBucket(reg prometheus.Registerer, bkt objstore.Bucket) objstore.InstrumentedBucket { | ||
return objstore.BucketWithMetrics(bkt.Name(), bkt, reg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed this:
return objstore.BucketWithMetrics(bkt.Name(), bkt, reg) | |
objstore.InstrumentedBucket(bkt.Name(), bkt, reg) |
so we have "InstrumentedBucket", "otel.TracingBucket", "opentracing.TracingBucket"? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see it in action thanos-io/thanos#6507
Do you have any other suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
Anyway, BucketWithMetrics
is now WrapWithMetrics
not InstrumentedBucket
as I suggested. You changed tracing one with TracedBucket
. It's improved, but the problem is still that it's a little bit inconsistent with TracedBucket
naming. Either let's call this one InstrumentedBucket
or if you want to keep WrapWithMetrics
, we could changed TracedBucket
to WrapWithTracing
? Small nit, just let be clear with what suggestion you agree and which not (:
Refactor client.NewBucket Add client.NewInstrumentedBucket Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
b3eeaf3
to
7b1439a
Compare
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Ping @bwplotka, is it ok to merge now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Still some unresolved comments, otherwise good to go!
client/factory.go
Outdated
return objstore.NewPrefixedBucket(bucket, bucketConf.Prefix), nil | ||
} | ||
|
||
// NewInstrumentedBucket initializes and returns new object storage clients. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not addressed.
client/factory.go
Outdated
|
||
// NewInstrumentedBucket initializes and returns new object storage clients. | ||
func NewInstrumentedBucket(reg prometheus.Registerer, bkt objstore.Bucket) objstore.InstrumentedBucket { | ||
return objstore.BucketWithMetrics(bkt.Name(), bkt, reg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean?
Anyway, BucketWithMetrics
is now WrapWithMetrics
not InstrumentedBucket
as I suggested. You changed tracing one with TracedBucket
. It's improved, but the problem is still that it's a little bit inconsistent with TracedBucket
naming. Either let's call this one InstrumentedBucket
or if you want to keep WrapWithMetrics
, we could changed TracedBucket
to WrapWithTracing
? Small nit, just let be clear with what suggestion you agree and which not (:
// Copyright (c) The Thanos Authors. | ||
// Licensed under the Apache License 2.0. | ||
|
||
package opentelemetry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be simplified to otel
if we want:
package opentelemetry | |
package otel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep naming consistent with already existing parts (opentracing
and opentelemetry
).
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
client.NewBucket
. Now it returns, uninstrumented and untraced bucket.Now you can combine
objstore.WrapWithMetrics
andtracing/{opentelemetry,opentracing}.WrapWithTraces
to have old behavior.Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com
Changes
Verification