-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 traces for ES storage #1197
Support archive traces for ES storage #1197
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1197 +/- ##
======================================
Coverage 100% 100%
======================================
Files 161 162 +1
Lines 7210 7263 +53
======================================
+ Hits 7210 7263 +53
Continue to review full report at Codecov.
|
afc261c
to
48e2095
Compare
This is ready for review @jaegertracing/elasticsearch @yurishkuro @objectiser Please read the first comment. We could also automatically default to write and read aliases and do not support no ttl use case. The question is also who should create aliases. We could embed it in Jaeger, although I am not sure about that approach. |
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.
@pavolloffay my one high level concern is this: the Cassandra storage (reader/writer) have no knowledge of whether they are operating on the main or archive keyspace, which results in a lot less code and special cases. Do you think the same is possible to achieve with ES, i.e. by parameterizing the reader/writer? I realize that because ES has no notion of the key spaces, there needs to be some variation, but couldn't it be achieved by simply passing a few config params like different index name patterns, instead of explicitly making reader/writer aware of "archive" notion and having branching behavior? What are the fundamental differences between the main and archive flows in ES?
That is what I wanted to achieve here too. The archive parameter is not present in reader/writer methods. it's only passed to the constructor which changes how indices are resolved. |
bfd2dbe
to
83b34b7
Compare
That's exactly what concerns me: imho nothing in Another high-level question: is it possible to transparently support the daily-index mode via index-alias mode (I assume not)? |
This is possible, at least for reads, via the curator and assigning multiple indices to the same alias.
Again, Aliases work well (and transparently) only for read operations:
Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html |
It would be nice if jaeger collector/ingester would perform the management of the write indices. It already creates new daily index opportunistically. We have a simple master election implementation for Cassandra used by adaptive sampling, can probably extend it to ES to pick one of the nodes to perform index rollover. |
ee71f61
to
02fd4d6
Compare
@yurishkuro what do you mean by:
Do you mean to create aliases if the rollover is being used? I think that is the only index functionality we could manage from jaeger. The other API that is necessary to call is
We will have to provide a component to create aliases and call rollover API. The first comment contains the curl calls. If we embed the alias creation to the collector it limits the naming patterns (maybe something more). I would put the index management into a separate component it's more flexible, power users could skip it and use their configurations. Note that the default behavior is without rollover API. What we have to solve is the migration from single index to rollover. If we will use slightly different index names for rollover we are fine users can easily migrate by putting old index to read alias. The other option is to use reindex API to change archive index name and then create alias with the original name. However reindex copies data which takes time so there will be downtime. |
Yes, it's what (I think) I meant. Sorry, too many nuances going on here. +1 on having an external mgmt component outside of collectors. However, are you sure it would work with daily indices, even if we normalize them with aliases? Today we create a new index when we see a span with the timestamp for the next day, right? Mgmt component won't have that info. Also, is es curator difficult to set up? If not, what is the value of writing our own? If we did mgmt out of collectors it's attractive because there are fewer things to deploy (btw totally agree with/ your point about the API for such thing). |
The alias does not contain date it would be simply an alias |
@jaegertracing/elasticsearch @yurishkuro @jpkrohling @objectiser could you please review? While doing the review could you please deploy multiple jaeger instances to single ES and especially verify that index prefix works as expected. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
cfeed61
to
0809856
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 - although would be good to get feedback from ES users to make sure the approach meets their requirements, both for the archive indices but also in future for the main indices.
@jaegertracing/elasticsearch it would be great if any of you guys could have a look and briefly comment on our approach. |
It's important to mention that the similar approach would be used for the main indices when using rollover. |
db8878b
to
e4f71f7
Compare
I think we should go forward and merge this PR. It will be available in latest images so people can try. If nobody objects I will merge it today EOD. |
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
e4f71f7
to
9832bef
Compare
TagKeysAsFields: tags, | ||
TagDotReplacement: f.primaryConfig.GetTagDotReplacement(), | ||
}), nil | ||
return createSpanWriter(f.metricsFactory, f.logger, f.archiveClient, f.primaryConfig, false) |
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.
@pavolloffay I think the client here should be f.primaryClient
and not f.archiveClient
Resolves #818
Related to #1242
This adds the implementation of archive storage for ES. There are two possible configurations how to use this feature:
jaeger-archive-span
index.jaeger-span-archive-write
and reads from an aliasjaeger-span-archive-read
. This deployment requires an external component that performs index managent: creating index, creating alias, callig rollover API and managingmax-span-age
by removing indices from read alias. This component isesRollover.py
available asjaeger-es-rollover
docker image.As the default index name does not collide with aliases used by rollover users can seameasly migrate from default deployment to rollover by putting
jaeger-archive-span
index into the read alias.Default use case
It does not require any configuration just deploying jaeger.
Rollover use case
It requires to create index
jaeger-span-archive-000001
and aliasesjaeger-span-archive-read
,jaeger-span-archive-write
.To enable rollover the following switch has to be enabled
Initialization
Initialize - create index and aliases
Rollover
Now we can start jaeger and archive traces. The next step is to rollover to new write index:
I am using max age 1s to trigger the rollover immmediately. This step can be repeated multiple times, The read alias should always point to all created indices, whereas write alias only to the last one.
Managing max-span-age and delete old indices
The last step is to remove old indices from read alias - to mimic
max-span-age
.We can also delete the old indices entirely by running es-index-cleaner
Note that it supports only days at unit.
Other
Indices: http://localhost:9200/_cat/indices
Aliases: http://localhost:9200/_cat/aliases
UI config to enable archive tab:
--query.ui-config ui-config.json
ES 6.4.4 supports
is_write_index
- it means that a single alias can be used for reads and writes (it points to multiple indices from which only one is write). We can add support later by using a different flag.The following command can be used to rollover and put the new index to read alias.
Note that all actions provided by
esRollover.py
can be written declarativelly as yml files for curator. Here is a working examlple https://gist.github.com/pavolloffay/5ce3f59f0967aadd5b019be411121c6c. The problem is to support index prefix. Yaml approach is quite nice but does not satifly our requirements if we want to have some fields configurable.