Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit 56960bd

Browse files
committed
Rename to K6_PROMETHEUS_RW_SERVER_URL
1 parent d4fecbf commit 56960bd

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ xk6 build --with github.com/grafana/xk6-output-prometheus-remote@latest
2020

2121
Then run new k6 binary with:
2222
```
23-
K6_PROMETHEUS_RW_REMOTE_URL=http://localhost:9090/api/v1/write ./k6 run script.js -o output-prometheus-remote
23+
K6_PROMETHEUS_RW_SERVER_URL=http://localhost:9090/api/v1/write ./k6 run script.js -o output-prometheus-remote
2424
```
2525

2626
Add TLS and HTTP basic authentication:
2727
```
28-
K6_PROMETHEUS_RW_REMOTE_URL=https://localhost:9090/api/v1/write \
28+
K6_PROMETHEUS_RW_SERVER_URL=https://localhost:9090/api/v1/write \
2929
K6_PROMETHEUS_RW_INSECURE_SKIP_TLS_VERIFY=false \
3030
K6_PROMETHEUS_RW_USERNAME=foo \
3131
K6_PROMETHEUS_RW_PASSWORD=bar \

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
ports:
4141
- "6565:6565"
4242
environment:
43-
- K6_PROMETHEUS_RW_REMOTE_URL=http://prometheus:9090/api/v1/write
43+
- K6_PROMETHEUS_RW_SERVER_URL=http://prometheus:9090/api/v1/write
4444
- K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true
4545
- K6_OUT=output-prometheus-remote
4646
depends_on:

pkg/remotewrite/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var defaultTrendStats = []string{"p(99)"}
2525

2626
type Config struct {
2727
// URL contains the absolute URL for the Write endpoint where to flush the time series.
28-
URL null.String `json:"url" envconfig:"K6_PROMETHEUS_RW_REMOTE_URL"`
28+
URL null.String `json:"url" envconfig:"K6_PROMETHEUS_RW_SERVER_URL"`
2929

3030
// Headers contains additional headers that should be included in the HTTP requests.
3131
Headers map[string]string `json:"headers" envconfig:"K6_PROMETHEUS_RW_HEADERS"`
@@ -200,7 +200,7 @@ func parseEnvs(env map[string]string) (Config, error) {
200200
}
201201
}
202202

203-
if url, urlDefined := env["K6_PROMETHEUS_RW_REMOTE_URL"]; urlDefined {
203+
if url, urlDefined := env["K6_PROMETHEUS_RW_SERVER_URL"]; urlDefined {
204204
c.URL = null.StringFrom(url)
205205
}
206206

pkg/remotewrite/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func TestOptionURL(t *testing.T) {
208208
jsonRaw json.RawMessage
209209
}{
210210
"JSON": {jsonRaw: json.RawMessage(`{"url":"http://prometheus:9090/api/v1/write"}`)},
211-
"Env": {env: map[string]string{"K6_PROMETHEUS_RW_REMOTE_URL": "http://prometheus:9090/api/v1/write"}},
211+
"Env": {env: map[string]string{"K6_PROMETHEUS_RW_SERVER_URL": "http://prometheus:9090/api/v1/write"}},
212212
//"Arg": {arg: "url=http://prometheus:9090/api/v1/write"},
213213
}
214214

0 commit comments

Comments
 (0)