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

Create ES index templates instead of indices #1627

Merged
merged 4 commits into from
Aug 2, 2019

Conversation

pavolloffay
Copy link
Member

@pavolloffay pavolloffay commented Jun 25, 2019

Resolves #374
Resolves #622

Instead of creating indices with mapping the collector at start time creates index template. ES uses this index template when a data is inserted to ES.

TODO

  • a flag to disable template creation

@codecov
Copy link

codecov bot commented Jun 25, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@815ad51). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1627   +/-   ##
=========================================
  Coverage          ?   98.51%           
=========================================
  Files             ?      193           
  Lines             ?     9274           
  Branches          ?        0           
=========================================
  Hits              ?     9136           
  Misses            ?      110           
  Partials          ?       28
Impacted Files Coverage Δ
plugin/storage/es/options.go 100% <100%> (ø)
plugin/storage/es/factory.go 100% <100%> (ø)
plugin/storage/es/spanstore/writer.go 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 815ad51...fd9030f. Read the comment docs.

Copy link
Contributor

@objectiser objectiser left a comment

Choose a reason for hiding this comment

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

LGTM - tested with and without index prefix.

@pavolloffay
Copy link
Member Author

Please do not merge yet!

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@pavolloffay
Copy link
Member Author

cc @jaegertracing/elasticsearch this PR changes behavior if the writer. Now jaeger will not be creating indices, but instead it will create index template at startup. There will be also a flag to disable template creation if it was previously manually installed by a user - needed if jaeger does not have manage permissions on the cluster see #1691 (comment).

Please comment if you have any concerns.

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@@ -214,6 +216,10 @@ func addFlags(flagSet *flag.FlagSet, nsConfig *namespaceConfig) {
"(experimental) Use read and write aliases for indices. Use this option with Elasticsearch rollover "+
"API. It requires an external component to create aliases before startup and then performing its management. "+
"Note that "+nsConfig.namespace+suffixMaxSpanAge+" is not taken into the account and has to be substituted by external component managing read alias.")
flagSet.Bool(
Copy link
Member Author

Choose a reason for hiding this comment

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

@yardbirdsax I have added boolean flag --es.create-index-templates which creates templates at startup when enabled. By default it is enabled.

Choose a reason for hiding this comment

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

That's awesome @pavolloffay , thanks!

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@pavolloffay
Copy link
Member Author

I will merge this by Friday. If you have any concerns please comment by then.

@dzmitry-lahoda
Copy link

is it in release 1.14?

@pavolloffay
Copy link
Member Author

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.

query error after run es_indices_clean.sh ElasticSearch index can be created with incorrect mapping
4 participants