-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support archive storage in the query-service #604
Conversation
f85cd74
to
34ea647
Compare
Signed-off-by: Yuri Shkuro <[email protected]>
d647750
to
4a4f01c
Compare
Signed-off-by: Yuri Shkuro <[email protected]>
ready for review |
func archiveOptions(storageFactory istorage.Factory, logger *zap.Logger) []app.HandlerOption { | ||
reader, err := storageFactory.CreateSpanReader() | ||
if err == istorage.ErrArchiveStorageNotConfigured || err == istorage.ErrArchiveStorageNotSupported { | ||
return nil |
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.
Wouldn't this fail silently when ErrArchiveStorageNotConfigured
is false; meaning it's configured; and when ErrArchiveStorageNotSupported
is true?
Shouldn't we return the ErrArchiveStorageNotSupported
when someone mistakenly configures archive storage on a storage that doesn't support archiving?
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.
it's not possible to configure archiving on a storage that doesn't support it. For example, with Cassandra you need to pass --cassandra-archive.enabled=true
.
if f.archiveSession == nil { | ||
return nil, storage.ErrArchiveStorageNotConfigured | ||
} | ||
return cSpanStore.NewSpanWriter(f.archiveSession, f.Options.SpanStoreWriteCacheTTL, f.metricsFactory, f.logger), nil |
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 a bit confused, is f.Options.SpanStoreWriteCacheTTL
shared between both the archive and primary span writers?
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.
at the moment, yes. The retention period of archive storage is expected to be much longer that for primary, so the short cache TTL for the primary is fine for archive too. Strictly speaking we don't even need this cache for archive, but whatever.
@@ -38,13 +44,14 @@ type Factory struct { | |||
|
|||
primaryConfig config.SessionBuilder | |||
primarySession cassandra.Session | |||
// archiveSession cassandra.Session TODO | |||
archiveConfig config.SessionBuilder |
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 feel that the archiveConfig
can be set to a higher default consistency level than the primaryConfig
. What do you think?
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.
it's fully configurable by user. Given how marginal this feature is overall, I don't think introducing custom defaults per storage class is worth the complexity in the code.
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.
do you wanna document this anywhere?
@@ -25,10 +25,12 @@ import ( | |||
"github.com/jaegertracing/jaeger/pkg/cassandra" | |||
"github.com/jaegertracing/jaeger/pkg/cassandra/mocks" | |||
"github.com/jaegertracing/jaeger/pkg/config" | |||
|
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.
?
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.
ppppphhhhh
|
||
// CreateArchiveSpanReader implements storage.ArchiveFactory | ||
func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) { | ||
factory, ok := f.factories[f.SpanStorageType] |
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 means that the span store and archive span store both have to be using the same storage type? I think that's a fair assumption
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.
it can be changed in the future by introducing another env var.
yes, once the UI support is added to actually archive traces (jaegertracing/jaeger-ui#7). |
Users often ask for this feature. The trace retention period is usually short, and often people would put a link to the trace into some issue tracker to improve service performance, but by the time someone starts working on the ticket the trace has already expired.
Resolves #603