-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[jaeger-v2] Storage backend integration tests #5254
Comments
## Which problem is this PR solving? - Resolves GRPC integration test sub-task at #5254 ## Description of the changes - Created a `grpc-integration-test.sh` script to run a jaeger remote storage and execute the end-to-end test through the OpenTelemetry Collector pipeline with the jaeger storage extension inside connected to the remote storage. To have a visualization of this architecture, see the proposal at #5254 - Separate the GRPC and Badger integration test CI because GRPC need to be run twice for the v1 and v2 versions. ## How was this change tested? - Run `./scripts/grpc-integration-test.sh latest` and the whole remote storage and pipeline will be built and executed for you. - I also ran a `jaeger-query`component to query traces from the remote storage for manual checks. <img width="1440" alt="Screenshot 2024-03-08 at 09 58 13" src="https://github.com/jaegertracing/jaeger/assets/46216691/2388e8bc-baf9-41bd-8baa-c3d51703fc8e"> ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: James Ryans <[email protected]>
@james-ryans as I was reviewing the PRs that follow from this issue, I am starting to have some concerns with this approach. Here is the set of requirements that I think we need to meet:
In the current state:
I think we can solve all 6 requirements by building upon our existing integration tests rather than with OTEL testbed. Perhaps we can also find a way to utilize the testbed's data generation ability and incorporate it as a step in the overall integration, but on itself I don't see how it can solve all requirements.
Achieving this will streamline our integration tests by converging onto a single framework, instead of using 3 different ones for bits and pieces. This is probably a large task, so I would like to find a path of incremental improvements that lead us to the overall goal. Let's give it some thought. |
There are some points that are still ambiguous for me, and I want to clarify things. Right now, I’ll just want to focus on the first three points of your vision and intention:
|
Yes, that is all correct. For instance, with ES, in the unit test model the test will instantiate |
unit test modeflowchart LR
Test -->|writeSpan| SpanWriter
SpanWriter --> B(StorageBackend)
Test -->|readSpan| SpanReader
SpanReader --> B
subgraph Integration Test Executable
Test
SpanWriter
SpanReader
end
e2e test modeflowchart LR
Test -->|writeSpan| SpanWriter
SpanWriter --> RPCW[RPC_client]
RPCW --> Receiver
Receiver --> Exporter
Exporter --> B(StorageBackend)
Test -->|readSpan| SpanReader
SpanReader --> RPCR[RPC_client]
RPCR --> jaeger_query
jaeger_query --> B
subgraph Integration Test Executable
Test
SpanWriter
SpanReader
RPCW
RPCR
end
subgraph jaeger-v2
Receiver
Exporter
jaeger_query
end
|
I have created an action plan to provide us with a clear, structured pathway so we can execute this in parallel. Some thoughts are welcome if my idea doesn't match with our vision.
With this, we can prototype the unit test and e2e test modes in parallel. But, after the unit test is merged, we need to refactor the e2e test to have a similar structure. Once the unit test and e2e test for one of the storage backends are merged, we can continue working on the other backends. After that, we can do refactoring and an example from plan 2 in parallel. The last one is to give some thoughts and find out how to test the interoperability between SDKs and exercise the receipt of different formats of data in |
And I'll try to prototype the e2e test for the gRPC storage backend since @Pushkarm029 is working on the gRPC unit test. |
@james-ryans a couple thoughts
|
Ohh wow, nice.. I overlooked that this task exists. I'll take a look at it.
Some components of it might be useful but we can implement it on our own with ease if we want to, probably modifying it for our specific use case. I'm thinking that we should be able to use OTEL testbed collector (testbed/testbed/in_process_collector.go) to start the jaeger-v2. Probably, also the OTEL testbed sender component to write the span data through RPC request. However, I still need to examine it to get a concrete picture. One concern is that the sender lacks the functionality to close the RPC connection. |
One main difference to me is that our integration tests generate very specific traces and then query for them in very specific ways, to actually exercise the querying capabilities & permutations. But OTEL testbed just generates a random flood of data and only checks that it all gets through (not even that, as I believe it only checks the IDs). That was really my question - what is the value of such data source? It's not really fuzz-testing since the data is still hardcoded (just permutated for the load). I could see it potentially being useful for stress testing, but we don't do that today (would need dedicated HW, not GH runners). |
The sender is just a wrapper for OTLP exporter that we are able to call the |
@yurishkuro with the new integration requirements, we don't need to test the collector pipeline with testbed as I proposed before anymore, is that right? If it is, we can just delete it. |
I think so, but that was really my question to you - if we used the testbed, what additional aspects or behavior would it be testing? |
Okay. It doesn't give any benefit anymore at this point, since all the test cases are already covered by the existing StorageIntegration. But we can use some parts of the components for ourselves to provide an easier setup for the new integration tests. |
## Which problem is this PR solving? - Part of #5254 (comment) solves (1) and (4) for gRPC storage integration test in e2e mode. ## Description of the changes - Utilizing existing `StorageIntegration` to test the jaeger-v2 OTel Collector and gRPC storage backend with the provided config file at `cmd/jaeger/grpc_config.yaml`. - Creates an abstraction for e2e test mode that initializes the collector, span writer to the receiver, and span reader from jaeger_query. ## How was this change tested? - Run `STORAGE=grpc SPAN_STORAGE_TYPE=memory make jaeger-v2-storage-integration-test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: James Ryans <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
Copying from #5355 (comment) - let's add this to the README. flowchart LR
Receiver --> Processor
Processor --> Exporter
JaegerStorageExension -->|"(1) get storage"| Exporter
Exporter -->|"(2) write trace"| Badger
Badger_e2e_test -->|"(1) POST /purge"| HTTP_endpoint
JaegerStorageExension -->|"(2) getStorage()"| HTTP_endpoint
HTTP_endpoint -.->|"(3) storage.(*Badger).Purge()"| Badger
subgraph Jaeger Collector
Receiver
Processor
Exporter
Badger
BadgerCleanerExtension
HTTP_endpoint
subgraph JaegerStorageExension
Badger
end
subgraph BadgerCleanerExtension
HTTP_endpoint
end
end
|
## Which problem is this PR solving? - part of #5254 ## Description of the changes - added badger e2e integration test ## How was this change tested? - tested locally ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - part of jaegertracing#5254 ## Description of the changes - added badger e2e integration test ## How was this change tested? - tested locally ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Vamshi Maskuri <[email protected]>
## Which problem is this PR solving? - part of #5254 ## Description of the changes - Utilizing existing `StorageIntegration` to test the jaeger-v2 OTel Collector and gRPC storage backend with the provided config file at `cmd/jaeger/config-elasticsearch.yaml`. ## How was this change tested? - Start a elasticsearch or opensearch docker instance. - Run `STORAGE=elasticsearch SPAN_STORAGE_TYPE=elasticsearch make jaeger-v2-storage-integration-test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Pushkar Mishra <[email protected]>
…ertracing#5345) ## Which problem is this PR solving? - part of jaegertracing#5254 ## Description of the changes - Utilizing existing `StorageIntegration` to test the jaeger-v2 OTel Collector and gRPC storage backend with the provided config file at `cmd/jaeger/config-elasticsearch.yaml`. ## How was this change tested? - Start a elasticsearch or opensearch docker instance. - Run `STORAGE=elasticsearch SPAN_STORAGE_TYPE=elasticsearch make jaeger-v2-storage-integration-test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Pushkar Mishra <[email protected]>
## Which problem is this PR solving? - part of #5254 ## Description of the changes - added cassandra integration tests - added method to purge cassandra storage ## How was this change tested? - some tests are failing ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Harshvir Potpose <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
Requirement
With the Jaeger storage extension for Jaeger-v2 is going to have full support of Jaeger-v1's storage backends, some unit tests on every storage backends are not enough. We need to conduct end-to-end tests of OpenTelemetry Collector pipeline to the targeted database.
Problem
There are still no integration tests to test the actual stored traces to the database from V2 Jaeger storage extension.
Proposal
Fortunately, OpenTelemetry Collector already has a testbed framework to help us conducting the end-to-end tests.
Testbed is a controlled environment and tools for conducting end-to-end tests for the OpenTelemetry Collector, including reproducible short-term benchmarks, correctness tests, long-running stability tests and maximum load stress tests. However, we will only utilize the correctness tests from testbed, it generates and sends every combinatorial trace attributes and matches every single of them with the received traces from another end.
Architecture of the integration test
Here's the architecture we will use to test the OpenTelemetry Collector pipeline from end-to-end with the designated storage backends.
Testbed components:
LoadGenerator
- encapsulates DataProvider and DataSender in order to generate and send data.Golden DataProvider
- generates traces from the "Golden" dataset generated using pairwise combinatorial testing techniques. Testbed example uses PICT to generate the test data, e.g. testdata.OTLP Trace DataSender
- with the generated traces from DataProvider, the DataSender sends traces to OTLP receiver in the collector instance.Mockbackend
- encapsulates DataReceiver and provides consume functionality.DataReceiver
- we will create a custom DataReceiver that will host a Jaeger storage extension to retrieve traces from the database by pulling them using our artificial Jaeger storage receiver [jaeger-v2] Add support for artificial jaeger storage receiver #5242.Consumer
- consumer does not actually a thing in MockBackend but only to make the diagram intuitive, the traces received from our artificial receiver will be stored inside MockBackend.Correctness Test Validator
- checks if the traces received from MockBackend are all matches with the generated traces from DataProvider.Plan
The execution of integration tests will be done incrementally one by one on every supported storage backends:
Purge
method for ES/OS #5407Open questions
No response
The text was updated successfully, but these errors were encountered: