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

Support data streams in create-track #1531

Merged
merged 18 commits into from
Jul 11, 2022
Merged

Conversation

gizas
Copy link
Contributor

@gizas gizas commented Jun 27, 2022

Info to validate and run PR:
https://github.com/elastic/observability-dev/issues/2194#issuecomment-1167531749

Error of junit testing:

 except BaseException as e:
>           raise AssertionError("Failed to install Elasticsearch {}.".format(distribution_version), e)
E           AssertionError: ('Failed to install Elasticsearch 7.6.0.', JSONDecodeError('Expecting value: line 1 column 1 (char 0)'))

pick 0338008 Commit to allow data-stream usage for create-track command
# This is a combination of 5 commits.
it/__init__.py:174: AssertionError
--------------------------------------------- generated xml file: /Users/andreasgkizas/elastic/rally/fork/rally/junit-py38-it.xml ---------------------------------------------
=========================================================================== short test summary info ===========================================================================
ERROR it/basic_test.py::test_run_without_arguments[in-memory-it] - AssertionError: ('Failed to install Elasticsearch 7.6.0.', JSONDecodeError('Expecting value: line 1 colum...
  • Relates #2194

Additional story created to track creation of test: #1538

Commit to allow data-stream usage even without indices flag

Updating error handling

Fixing lint errors

Fixing format errors
Copy link
Contributor

@michaelbaamonde michaelbaamonde left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on @gizas! I left some comments after a first pass.

I also think it'd be good to come up with an integration test for this new functionality, similar to this one. I'll give this some more thought come up with some options for seeding Elasticsearch with datastreams in such a test. Conveniently, elastic/rally-tracks#275 is in review and we may be able to use that once it's merged.

esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/tracker.py Outdated Show resolved Hide resolved
Copy link
Contributor

@j-bennet j-bennet left a comment

Choose a reason for hiding this comment

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

There seems to be a little bit of a mismatch between what the code in doing in datastreamextract, and what the comments are saying. It would be good to have that clarified.

esrally/rally.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/index.py Outdated Show resolved Hide resolved
esrally/tracker/tracker.py Outdated Show resolved Hide resolved
@gizas
Copy link
Contributor Author

gizas commented Jun 30, 2022

I also think it'd be good to come up with an integration test for this new functionality, similar to this one. I'll give this some more thought come up with some options for seeding Elasticsearch with datastreams in such a test. Conveniently, elastic/rally-tracks#275 is in review and we may be able to use that once it's merged.

I have added a dummy placeholder for a new test here ba02999
Can we sync on how to ingest datastream inside Elasticsearch?

@gizas
Copy link
Contributor Author

gizas commented Jul 6, 2022

Story for test created #1538

Copy link
Contributor

@michaelbaamonde michaelbaamonde 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 looking good to me, but since @pquentin had the most recent feedback, let's make sure he's good with the latest commits before merging. Thanks for all the iteration on this @gizas!

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks for itereating! We're nearly there.

So adding an integration test is tough, but can you please add an unit test for datastreams support? See test_extract_index_create in tests/tracker/index_test.py for the existing index test.

@gizas
Copy link
Contributor Author

gizas commented Jul 8, 2022

Some more tests to allow hidden indices

❯ esrally create-track  --indices=".ds-metrics-kubernetes-*" 

[ERROR] Cannot create-track. Failed to extract any indices for track!.

❯ esrally create-track --indices=".ds-metrics-kubernetes*" 
Extracting documents for index [.ds-metrics-kubernetes...     1000/1000 docs [100.0% done]
Extracting documents for index [.ds-metrics-kubern...     447468/1522057 docs [29.4% done]

❯ esrally create-track --indices=".ds-logs*" 
Extracting documents for index [.ds-logs-elastic_agent...     1000/1000 docs [100.0% done]
Extracting documents for index [.ds-logs-elastic_ag...     154360/908119 docs [17.0% done]

❯ esrally create-track --track=test  --indices=".ds-logs*"  --data-streams="metrics-*"

usage: esrally create-track [-h] --track TRACK (--indices INDICES | --data-streams DATA_STREAMS) --target-hosts TARGET_HOSTS [--client-options CLIENT_OPTIONS] [--output-path OUTPUT_PATH] [--quiet] [--offline]
esrally create-track: error: argument --data-streams: not allowed with argument --indices

❯ esrally create-track --data-streams="metrics-*" 
[INFO] Connected to Elasticsearch cluster [ha-es-zone-d-0] version [8.3.0-SNAPSHOT].

Extracting documents for index [.ds-metrics-elastic_ag...     1000/1000 docs [100.0% done]
Extracting documents for index [.ds-metrics-elastic_a...     12850/257181 docs [5.0% done]

@gizas
Copy link
Contributor Author

gizas commented Jul 8, 2022

So adding an integration test is tough, but can you please add an unit test for datastreams support? See test_extract_index_create in tests/tracker/index_test.py for the existing index test.

Added in 39450ec

Also one additional use case added NOT to allow hidden indices when filter is "_all"
Overall hidden indices are supported with --indices and data-streams and blocked when filter is "_all"

❯ esrally create-track --track=test --indices="_all" 

[ERROR] Cannot create-track. Failed to extract any indices for track!.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thank you! This looks great now.

@gizas gizas merged commit 693d728 into elastic:master Jul 11, 2022
@gizas gizas deleted the fixing_create_track branch July 11, 2022 06:54
@pquentin pquentin added enhancement Improves the status quo highlight A substantial improvement that is worth mentioning separately in release notes labels Nov 2, 2022
@pquentin pquentin added this to the 2.7.0 milestone Nov 2, 2022
@pquentin pquentin changed the title [Fixing create-track] Support data streams in create-track Support data streams in create-track Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves the status quo highlight A substantial improvement that is worth mentioning separately in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants