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

[jaeger-v2] add gRPC integration e2e test mode #5322

Merged
merged 31 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 23 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 Apr 3, 2024
631f030
Refactor changed integration functions
james-ryans Apr 3, 2024
7f2e18e
Fix should have grpc_test empty refresh function
james-ryans Apr 3, 2024
5ffd7dd
Add explanations to the e2e storage integration
james-ryans Apr 3, 2024
ad61084
Refactor hardcoded config file into a struct field
james-ryans Apr 3, 2024
562c85b
Fix CodeQL on SpanReader.FindTraces query.NumTraces cast
james-ryans Apr 3, 2024
3558e92
Refactor all initialization and clean up function as a test component
james-ryans Apr 3, 2024
8ece354
Refactor SpanWriter and SpanReader into separate files
james-ryans Apr 3, 2024
1127445
Refactor RunSpanStoreTests and invoke from RunAll
james-ryans Apr 3, 2024
b00b2d2
Refactor extract grpc server into a single file
james-ryans Apr 4, 2024
53226e2
Refactor replace testbed test with new test and change README
james-ryans Apr 4, 2024
6a8955a
Refactor by changing in_process_collector to built binary
james-ryans Apr 4, 2024
dbb4107
Refactor spanWriter and spanReader to implement io.Closer
james-ryans Apr 5, 2024
5e1e093
Close grpc server at the end of the test
james-ryans Apr 5, 2024
d6c1fbb
Add goleak check
james-ryans Apr 5, 2024
0beaaca
Add error checking when shutting down grpc server
james-ryans Apr 5, 2024
e1aba5a
Make GRPCServer.Start idempotent by closing it if already running
james-ryans Apr 5, 2024
2dddea9
Make GRPCServer.Close idempotent by checking if already closed
james-ryans Apr 5, 2024
1ae55b2
Chore fix span_writer and span_reader import format
james-ryans Apr 5, 2024
0f2ceb4
Fix the initialize() called twice
james-ryans Apr 5, 2024
992542a
Move cmd.Process.Kill() to inside t.CleanUp
james-ryans Apr 5, 2024
5dc1b34
Merge branch 'main' into integration-e2e-test-mode
james-ryans Apr 5, 2024
4fb4fff
Avoid using channel in GRPCServer
james-ryans Apr 6, 2024
f2cea9f
Refactor GRPCServer to reuse remote-storage server
james-ryans Apr 7, 2024
9b5b147
Add comment to integration.go to clarify the usage
james-ryans Apr 7, 2024
18876bd
Refactor spanWriter and spanReader to start on creation
james-ryans Apr 7, 2024
ca75924
Fix ci-grpc v1 should define env SPAN_STORAGE_TYPE=memory
james-ryans Apr 7, 2024
2955865
Temporarily skip testing trace binary type tags
james-ryans Apr 8, 2024
779dff8
Delete unused spanReader Start func
james-ryans Apr 8, 2024
5610e5c
Refactor remote_memory_storage to use *testing.T
james-ryans Apr 9, 2024
d88a6a5
Merge branch 'main' into integration-e2e-test-mode
yurishkuro Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ignore:
- "thrift-gen/*/*"
- "**/thrift-0.9.2/*"
- "**/main.go"
- "cmd/jaeger/internal/integration/datareceivers"
- "examples/hotrod"

coverage:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:
make grpc-storage-integration-test
;;
v2)
bash scripts/grpc-integration-test.sh latest
STORAGE=grpc \
SPAN_STORAGE_TYPE=memory \
make jaeger-v2-storage-integration-test
;;
esac

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ all-in-one-integration-test:
# The integration tests are filtered by STORAGE env,
# currently the available STORAGE variable is:
# - grpc
.PHONY: jaeger-storage-integration-test
jaeger-storage-integration-test:
.PHONY: jaeger-v2-storage-integration-test
jaeger-v2-storage-integration-test:
(cd cmd/jaeger/ && go build .)
# Expire tests results for jaeger storage integration tests since the environment might change
# even though the code remains the same.
go clean -testcache
Expand Down
4 changes: 0 additions & 4 deletions cmd/jaeger/grpc_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ service:
extensions:
jaeger_query:
trace_storage: external-storage
trace_storage_archive: external-storage-archive
ui_config: ./cmd/jaeger/config-ui.json

jaeger_storage:
grpc:
external-storage:
server: localhost:17271
connection-timeout: 5s
external-storage-archive:
server: localhost:17281
connection-timeout: 5s
yurishkuro marked this conversation as resolved.
Show resolved Hide resolved

receivers:
otlp:
Expand Down
43 changes: 29 additions & 14 deletions cmd/jaeger/internal/integration/README.md
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.
![integration diagram](integration-diagram.png)
```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
```
1 change: 0 additions & 1 deletion cmd/jaeger/internal/integration/datareceivers/.nocover

This file was deleted.

97 changes: 0 additions & 97 deletions cmd/jaeger/internal/integration/datareceivers/jaegerstorage.go

This file was deleted.

Loading
Loading