| load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") |
| |
| go_library( |
| name = "metrics", |
| srcs = [ |
| "discovery.go", |
| "exporters.go", |
| "metrics.go", |
| ], |
| importpath = "source.monogon.dev/metropolis/node/core/metrics", |
| visibility = ["//visibility:public"], |
| deps = [ |
| "//go/types/mapsets", |
| "//metropolis/node/allocs", |
| "//metropolis/node/core/curator/proto/api", |
| "//metropolis/node/core/curator/watcher", |
| "//metropolis/node/core/identity", |
| "//osbase/supervisor", |
| "@com_github_prometheus_client_golang//prometheus", |
| "@com_github_prometheus_client_golang//prometheus/promhttp", |
| ], |
| ) |
| |
| go_test( |
| name = "metrics_test", |
| srcs = ["metrics_test.go"], |
| data = [ |
| "//metropolis/node/core/metrics/fake_exporter", |
| ], |
| embed = [":metrics"], |
| x_defs = { |
| "xFakeExporterPath": "$(rlocationpath //metropolis/node/core/metrics/fake_exporter )", |
| }, |
| deps = [ |
| "//metropolis/node/allocs", |
| "//metropolis/node/core/curator/proto/api", |
| "//metropolis/test/util", |
| "//osbase/supervisor", |
| "//osbase/test/freeport", |
| "@com_zx2c4_golang_wireguard_wgctrl//wgtypes", |
| "@io_bazel_rules_go//go/runfiles", |
| ], |
| ) |