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

[WIP][feat]: Support elasticsearch data stream #6551

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zzzk1
Copy link
Contributor

@zzzk1 zzzk1 commented Jan 16, 2025

Which problem is this PR solving?

Resolves #4708

Provide follow API to client

  • Create ILM Policy
  • Create DataStream using exist index template
  • Convert index alias with a write index to a DataStream

Description of the changes

  • allow ilm_client to create ILM Policy directly

How was this change tested?

  • unit test & intergration test

Checklist

cmd/es-rollover/app/flags.go Outdated Show resolved Hide resolved
@Manik2708
Copy link
Contributor

@yurishkuro @zzzk1 My question for this PR is: Do we need to support DefaultPolicy through es-rollover? ILM is to automate rollover and back data streams index, when the need is to automate rollover why should we keep it in a script which requires mannual rollover?

@zzzk1
Copy link
Contributor Author

zzzk1 commented Jan 17, 2025

@yurishkuro @zzzk1 My question for this PR is: Do we need to support DefaultPolicy through es-rollover? ILM is to automate rollover and back data streams index, when the need is to automate rollover why should we keep it in a script which requires mannual rollover?

@Manik2708 Thanks for your remind. Just for testing easily now; once all features are implemented, then migration to cmd/Jaeger will occur.

@zzzk1 zzzk1 marked this pull request as draft January 18, 2025 09:40
@zzzk1 zzzk1 force-pushed the sup-data-stream branch 5 times, most recently from 20d8aeb to ae5e6b6 Compare January 18, 2025 13:42
Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.23%. Comparing base (b04e0ba) to head (56b2b20).

Files with missing lines Patch % Lines
pkg/es/client/ilm_client.go 85.00% 2 Missing and 1 partial ⚠️
pkg/es/client/datastream_client.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6551      +/-   ##
==========================================
- Coverage   96.24%   96.23%   -0.02%     
==========================================
  Files         373      374       +1     
  Lines       21406    21439      +33     
==========================================
+ Hits        20602    20631      +29     
- Misses        612      615       +3     
- Partials      192      193       +1     
Flag Coverage Δ
badger_v1 10.64% <ø> (ø)
badger_v2 2.77% <ø> (ø)
cassandra-4.x-v1-manual 16.58% <ø> (ø)
cassandra-4.x-v2-auto 2.71% <ø> (ø)
cassandra-4.x-v2-manual 2.71% <ø> (ø)
cassandra-5.x-v1-manual 16.58% <ø> (ø)
cassandra-5.x-v2-auto 2.71% <ø> (ø)
cassandra-5.x-v2-manual 2.71% <ø> (ø)
elasticsearch-6.x-v1 20.37% <ø> (ø)
elasticsearch-7.x-v1 20.44% <ø> (ø)
elasticsearch-8.x-v1 20.59% <ø> (ø)
elasticsearch-8.x-v2 2.77% <ø> (-0.11%) ⬇️
grpc_v1 12.16% <ø> (ø)
grpc_v2 9.02% <ø> (ø)
kafka-3.x-v1 10.32% <ø> (ø)
kafka-3.x-v2 2.77% <ø> (ø)
memory_v2 2.77% <ø> (+<0.01%) ⬆️
opensearch-1.x-v1 20.49% <ø> (+<0.01%) ⬆️
opensearch-2.x-v1 20.48% <ø> (-0.01%) ⬇️
opensearch-2.x-v2 2.76% <ø> (-0.01%) ⬇️
tailsampling-processor 0.51% <ø> (ø)
unittests 95.08% <87.87%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

// CreateOrUpdate Add or update a ILMPolicy
func (i ILMClient) CreateOrUpdate(name string, ilmPolicy Policy) error {
Copy link
Member

Choose a reason for hiding this comment

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

how would our own code know what the policy should look like?

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

This is a large new feature, please describe how you see everything working before jumping into implementation (which is likely going to be a waste of time if we don't agree on the approach first)

@zzzk1
Copy link
Contributor Author

zzzk1 commented Jan 20, 2025

This is a large new feature, please describe how you see everything working before jumping into implementation (which is likely going to be a waste of time if we don't agree on the approach first)

Yes, I will submit a descripton doc

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.

[Feature]: Support elasticsearch data stream
3 participants