You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sender: ## Run sender compliance tests for a given PROMETHEUS_RW2_COMPLIANCE_SENDERS with a HTML results view.
17
-
cd ./sender && DEBUG=$(DEBUG) PROMETHEUS_RW2_COMPLIANCE_SENDERS="$(PROMETHEUS_RW2_COMPLIANCE_SENDERS)" go test -json | tee results.json
18
-
@echo "Opening HTML result view; load the `results.json` file"
19
-
@open ./index.html
20
-
21
-
.PHONY: sender-check
22
-
sender-ci: ## Run sender compliance tests for a given PROMETHEUS_RW2_COMPLIANCE_SENDERS suitable for CI.
23
-
cd ./sender && DEBUG=$(DEBUG) PROMETHEUS_RW2_COMPLIANCE_SENDERS="$(PROMETHEUS_RW2_COMPLIANCE_SENDERS)" go test -v
28
+
sender: ## Run sender compliance tests for a given senders suitable for humans and CI.
29
+
cd ./sender && DEBUG=$(DEBUG) PROMETHEUS_COMPLIANCE_RW_SENDERS=$(PROMETHEUS_COMPLIANCE_RW_SENDERS) go test -run $(PROMETHEUS_RW_COMPLIANCE_TEST_RE) -skip $(PROMETHEUS_RW_COMPLIANCE_SKIP_TEST_RE) -v -timeout=$(TIMEOUT)
30
+
31
+
.PHONY: sender-html
32
+
sender-html: ## Run sender compliance tests for a given senders with a HTML results view.
33
+
@cd ./sender && DEBUG=$(DEBUG) PROMETHEUS_COMPLIANCE_RW_SENDERS=$(PROMETHEUS_COMPLIANCE_RW_SENDERS) go test -run $(PROMETHEUS_RW_COMPLIANCE_TEST_RE) -skip $(PROMETHEUS_RW_COMPLIANCE_SKIP_TEST_RE) -json | tee $(RESULT_FILE)
receiver: ## Run receiver compliance tests for a given receivers suitable for humans and CI.
40
+
cd ./receiver && DEBUG=$(DEBUG) PROMETHEUS_RW2_COMPLIANCE_RECEIVERS=$(PROMETHEUS_RW2_COMPLIANCE_RECEIVERS) go test -run $(PROMETHEUS_RW_COMPLIANCE_TEST_RE) -skip $(PROMETHEUS_RW_COMPLIANCE_SKIP_TEST_RE) -v -timeout=$(TIMEOUT)
41
+
42
+
.PHONY: receiver-html
43
+
receiver-html: ## Run receiver compliance tests for a given receivers with a HTML results view.
44
+
@cd ./receiver && DEBUG=$(DEBUG) PROMETHEUS_RW2_COMPLIANCE_RECEIVERS=$(PROMETHEUS_RW2_COMPLIANCE_RECEIVERS) go test -run $(PROMETHEUS_RW_COMPLIANCE_TEST_RE) -skip $(PROMETHEUS_RW_COMPLIANCE_SKIP_TEST_RE) -json | tee $(RESULT_FILE)
45
+
@$(MAKE) open-preloaded-results
46
+
47
+
48
+
.PHONY: open-preloaded-results
49
+
open-preloaded-results: # Open index.html with the preloaded results from results.json file.
50
+
@# Preload to avoid CORS issue on secure browsers.
Copy file name to clipboardExpand all lines: remotewrite/README.md
+38-40Lines changed: 38 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,35 +7,39 @@ Both [sender](#sender-compliance-sender) and [receiver](#receiver-compliance-rec
7
7
To generate and view results, add `-json` flag to `go test` command and `tee` the results to a file called `results.json`.
8
8
9
9
Tests are marked with compliance levels according to RFC specifications:
10
-
-**MUST**: Required by specification
11
-
-**SHOULD**: Recommended by specification
12
-
-**MAY**: Could have by specification
13
-
-**RECOMMENDED**: Not in specification but recommended for performance
10
+
-**MUST**: Required by Remote Write specification
11
+
-**SHOULD**: Recommended by Remote Write specification
12
+
-**MAY**: Could have by Remote Write specification
13
+
-**RECOMMENDED**: Not in Remote Write specification, but recommended for performance or Prometheus compatibility reasons
14
14
15
15
## Sender Compliance (`/sender`)
16
16
17
-
Tests that Remote-Write senders properly implement the protocol by forking sender instances (e.g., Prometheus), examining generated requests, and validating them against the specification.
17
+
Tests that Remote-Write senders implement the RW2 protocol by running tests cases with:
18
+
19
+
1. Scraper exposing OpenMetrics 1.0
20
+
2. Target sender to test (e.g., Prometheus),
21
+
3. Special receiver that tests various elements of the request(s).
18
22
19
23
Tests cover:
24
+
- Series encoding
20
25
- Float samples encoding
21
26
- Native Histograms encoding
22
27
- Exemplars encoding
23
-
- Protocol headers and content negotiation
24
-
- Error handling and retry logic
25
-
- Backoff and batching behavior
26
-
- Metadata and symbol table management
28
+
- Metadata encoding
29
+
- Protocol headers
30
+
- Error handling, basic batching and retry logic
27
31
- Request formatting and compression
28
-
29
-
### Limitations
30
-
31
-
The test suite validates the format and structure of requests sent by the sender but does not verify end-to-end data flow or persistence. Because senders may have different configuration options and capabilities, passing all tests does not guarantee a sender supports every Remote-Write feature (such as Native Histograms). Some senders may not expose certain features or may require specific configuration.
32
+
- Various Prometheus / OpenMetrics 1.0 semantics as "RECOMMENDED" (staleness, upness). Because this test depends on scraping behaviour we
33
+
are testing some elements of the exposition format support too.
32
34
33
35
### Prerequisites
34
36
35
37
- Go 1.23 or later
36
-
- The sender binary to test (e.g., Prometheus)
38
+
- The sender binary you want to test (e.g., Prometheus)
39
+
- Requires OpenMetrics 1.0 scrape capability.
40
+
- Required Remote Write sending capability.
37
41
38
-
The test suite automatically downloads and runs Prometheus as the reference sender implementation. For testing custom senders, place the binary in the `bin/` directory.
42
+
The test suite automatically downloads and runs Prometheus as the reference sender implementation.
39
43
40
44
### Configuration
41
45
@@ -47,6 +51,15 @@ The test suite uses environment variables:
47
51
PROMETHEUS_RW2_COMPLIANCE_SENDERS="prometheus"
48
52
```
49
53
54
+
Currently supported senders:
55
+
-`prometheus` - The reference Prometheus implementation (automatically downloaded).
56
+
-`process` - For custom sender that is a local binary.
57
+
58
+
For testing custom senders:
59
+
60
+
* Add target running code and register it the `sender/main_test.go`.
61
+
* Use custom process target via `PROMETHEUS_COMPLIANCE_RW_SENDERS="process"` and `PROMETHEUS_COMPLIANCE_RW_PROCESS_BINARY=<path>` envvars.
62
+
50
63
**Debug output:**
51
64
52
65
Debug variable controls if the tested process suppresses output (empty DEBUG) or not.
@@ -55,28 +68,20 @@ Debug variable controls if the tested process suppresses output (empty DEBUG) or
55
68
DEBUG="1"
56
69
```
57
70
58
-
Currently supported senders:
59
-
-`prometheus` - The reference Prometheus implementation (automatically downloaded)
60
-
61
71
### Running Tests
62
72
63
73
```bash
64
-
pushd ./sender
65
-
# Run compliance tests e.g. for the default prometheus binary ...
66
-
PROMETHEUS_RW2_COMPLIANCE_SENDERS="prometheus" go test -v
67
-
popd
74
+
make sender
68
75
```
69
76
70
-
To use visualization HTML page, export data to JSON and generate `results.json` e.g.
77
+
To use visualization HTML page:
71
78
72
79
```bash
73
-
pushd ./sender
74
-
PROMETHEUS_RW2_COMPLIANCE_SENDERS="prometheus" go test -json | tee results.json
75
-
popd
76
-
77
-
# Open ./index.html in your browser and see results.
80
+
make sender-html
78
81
```
79
82
83
+
See Makefile for detailed invocation.
84
+
80
85
## Receiver Compliance (`/receiver`)
81
86
82
87
Tests that Remote-Write endpoints properly handle incoming requests by sending various Remote-Write v2 requests and validating responses.
0 commit comments