-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[jaeger-v2] add gRPC integration e2e test mode #5322
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
Merged
yurishkuro
merged 31 commits into
jaegertracing:main
from
james-ryans:integration-e2e-test-mode
Apr 9, 2024
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
32b0678
Add gRPC integration e2e test mode
james-ryans 631f030
Refactor changed integration functions
james-ryans 7f2e18e
Fix should have grpc_test empty refresh function
james-ryans 5ffd7dd
Add explanations to the e2e storage integration
james-ryans ad61084
Refactor hardcoded config file into a struct field
james-ryans 562c85b
Fix CodeQL on SpanReader.FindTraces query.NumTraces cast
james-ryans 3558e92
Refactor all initialization and clean up function as a test component
james-ryans 8ece354
Refactor SpanWriter and SpanReader into separate files
james-ryans 1127445
Refactor RunSpanStoreTests and invoke from RunAll
james-ryans b00b2d2
Refactor extract grpc server into a single file
james-ryans 53226e2
Refactor replace testbed test with new test and change README
james-ryans 6a8955a
Refactor by changing in_process_collector to built binary
james-ryans dbb4107
Refactor spanWriter and spanReader to implement io.Closer
james-ryans 5e1e093
Close grpc server at the end of the test
james-ryans d6c1fbb
Add goleak check
james-ryans 0beaaca
Add error checking when shutting down grpc server
james-ryans e1aba5a
Make GRPCServer.Start idempotent by closing it if already running
james-ryans 2dddea9
Make GRPCServer.Close idempotent by checking if already closed
james-ryans 1ae55b2
Chore fix span_writer and span_reader import format
james-ryans 0f2ceb4
Fix the initialize() called twice
james-ryans 992542a
Move cmd.Process.Kill() to inside t.CleanUp
james-ryans 5dc1b34
Merge branch 'main' into integration-e2e-test-mode
james-ryans 4fb4fff
Avoid using channel in GRPCServer
james-ryans f2cea9f
Refactor GRPCServer to reuse remote-storage server
james-ryans 9b5b147
Add comment to integration.go to clarify the usage
james-ryans 18876bd
Refactor spanWriter and spanReader to start on creation
james-ryans ca75924
Fix ci-grpc v1 should define env SPAN_STORAGE_TYPE=memory
james-ryans 2955865
Temporarily skip testing trace binary type tags
james-ryans 779dff8
Delete unused spanReader Start func
james-ryans 5610e5c
Refactor remote_memory_storage to use *testing.T
james-ryans d88a6a5
Merge branch 'main' into integration-e2e-test-mode
yurishkuro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,42 @@ | ||
| # Integration | ||
|
|
||
| Jaeger v2 integration tests are built on top of [OTEL Testbed module](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/testbed). OTEL Testbed provide comprehensive tools for conducting end-to-end tests for the OTEL Collector, such as reproducible short-term benchmarks, correctness tests, long-running stability tests and maximum load stress tests. However, we 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. To learn more about OTEL Testbed, please refer to the their [README](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/testbed/README.md). | ||
| The Jaeger v2 integration test is an extension of the existing `integration.StorageIntegration` designed to test the Jaeger-v2 OtelCol binary; currently, it only tests the span store. The existing tests at `plugin/storage/integration` (also called "unit mode") test by writing and reading span data directly to the storage API. In contrast, these tests (or "e2e mode") read and write span data through the RPC client to the Jaeger-v2 OtelCol binary. E2E mode tests read from the jaeger_query extension and write to the receiver in OTLP formats. For details, see the [Architecture](#architecture) section below. | ||
|
|
||
| ## Architecture | ||
|
|
||
| Here's the architecture to test the OpenTelemetry Collector pipeline from end-to-end with the designated storage backends. | ||
|  | ||
| ```mermaid | ||
| flowchart 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 | ||
|
|
||
| Testbed components: | ||
| | Component | Description | | ||
| |-----------|-------------| | ||
| | **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](https://github.com/microsoft/pict/) to generate the test data, e.g. [testdata](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/internal/coreinternal/goldendataset/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 | 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. | | ||
| | 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. | | ||
| subgraph Integration Test Executable | ||
| Test | ||
| SpanWriter | ||
| SpanReader | ||
| RPCW | ||
| RPCR | ||
| end | ||
|
|
||
| subgraph jaeger-v2 | ||
| Receiver | ||
| Exporter | ||
| jaeger_query | ||
| end | ||
| ``` | ||
|
|
||
| ## gRPC Integration Test | ||
|
|
||
| To conduct the tests, run the following command: | ||
|
|
||
| ``` | ||
| scripts/grpc-integration-test.sh <remote_storage_image_version> | ||
| STORAGE=grpc \ | ||
| SPAN_STORAGE_TYPE=memory \ | ||
| make jaeger-v2-storage-integration-test | ||
| ``` |
This file was deleted.
Oops, something went wrong.
97 changes: 0 additions & 97 deletions
97
cmd/jaeger/internal/integration/datareceivers/jaegerstorage.go
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.