Skip to content

Commit

Permalink
use ngix image to provide the module via http
Browse files Browse the repository at this point in the history
  • Loading branch information
wildum committed Dec 14, 2023
1 parent d98d207 commit 190e674
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 52 deletions.
9 changes: 0 additions & 9 deletions integration-tests/configs/http-module/Dockerfile

This file was deleted.

38 changes: 0 additions & 38 deletions integration-tests/configs/http-module/main.go

This file was deleted.

21 changes: 21 additions & 0 deletions integration-tests/configs/http-module/module.river
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare "myModule" {
argument "scrape_endpoint" {}

argument "forward_to" {}

argument "scrape_interval" {
optional = true
default = "1s"
}

prometheus.scrape "scrape_prom_metrics_module_file" {
targets = [
{"__address__" = argument.scrape_endpoint.value},
]
forward_to = argument.forward_to.value
scrape_classic_histograms = true
enable_protobuf_negotiation = true
scrape_interval = argument.scrape_interval.value
scrape_timeout = "500ms"
}
}
8 changes: 4 additions & 4 deletions integration-tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ services:
- "9001:9001"

http-module:
build:
dockerfile: ./integration-tests/configs/http-module/Dockerfile
context: ..
image: nginx:alpine
ports:
- "8090:8090"
- "8090:80"
volumes:
- ./configs/http-module/module.river:/usr/share/nginx/html/module.river:ro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import.http "scrape_module" {
url = "http://localhost:8090/stream"
url = "http://localhost:8090/module.river"
}

scrape_module.myModule "scrape_prom_metrics_module_http" {
Expand Down

0 comments on commit 190e674

Please sign in to comment.