Support archive storage in the query-service#604
Conversation
f85cd74 to
34ea647
Compare
Signed-off-by: Yuri Shkuro <ys@uber.com>
d647750 to
4a4f01c
Compare
|
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.
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.
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.
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.
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.
| primaryConfig config.SessionBuilder | ||
| primarySession cassandra.Session | ||
| // archiveSession cassandra.Session TODO | ||
| archiveConfig config.SessionBuilder |
There was a problem hiding this comment.
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.
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.
black-adder
left a comment
There was a problem hiding this comment.
do you wanna document this anywhere?
| "github.com/jaegertracing/jaeger/pkg/cassandra" | ||
| "github.com/jaegertracing/jaeger/pkg/cassandra/mocks" | ||
| "github.com/jaegertracing/jaeger/pkg/config" | ||
|
|
|
|
||
| // CreateArchiveSpanReader implements storage.ArchiveFactory | ||
| func (f *Factory) CreateArchiveSpanReader() (spanstore.Reader, error) { | ||
| factory, ok := f.factories[f.SpanStorageType] |
There was a problem hiding this comment.
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.
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