-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Integration Tests Windows | ||
on: | ||
# Run tests on main just so the module and build cache can be saved and used | ||
# in PRs. This speeds up the time it takes to test PRs dramatically. | ||
# (More information on https://docs.github.com/en/[email protected]/actions/using-workflows/caching-dependencies-to-speed-up-workflows) | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
run_tests: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22" | ||
- name: Run tests | ||
run: make integration-test |
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
prometheus.exporter.windows "default" { } | ||
|
||
prometheus.scrape "default" { | ||
targets = prometheus.exporter.windows.default.targets | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
scrape_interval = "1s" | ||
scrape_timeout = "500ms" | ||
} | ||
|
||
prometheus.remote_write "default" { | ||
endpoint { | ||
url = "http://localhost:9009/api/v1/push" | ||
metadata_config { | ||
send_interval = "1s" | ||
} | ||
queue_config { | ||
max_samples_per_send = 100 | ||
} | ||
} | ||
external_labels = { | ||
test_name = "win_metrics", | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
internal/cmd/integration-tests/tests/windows/windows_metrics_test.go
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//go:build windows | ||
|
||
package main | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/grafana/alloy/internal/cmd/integration-tests/common" | ||
) | ||
|
||
func TestWindowsMetrics(t *testing.T) { | ||
var winMetrics = []string{ | ||
"windows_cpu_logical_processor", // cpu | ||
"windows_cs_logical_processors", // cs | ||
"windows_logical_disk_info", // logical_disk | ||
"windows_net_bytes_received_total", // net | ||
"windows_os_info", // os | ||
"windows_service_info", // service | ||
"windows_system_processes", // system | ||
} | ||
common.MimirMetricsTest(t, winMetrics, []string{}, "win_metrics") | ||
} |