m/n/kubernetes: add metricsprovider

Kubernetes has a metrics provider interface, add an adapter to be able
to get these into our Prometheus registry. This code exists in a similar
form inside K8s but against their custom metrics architecture, not plain
Prometheus.

As these metrics are shared across all workqueues we follow K8s in
implementing this with a singleton/global. It's not the prettiest, but
otherwise we may get issues with Prometheus and duplicate metrics.

Change-Id: I0b6d608d14793e44859166a5a59d446c8f662a25
Reviewed-on: https://review.monogon.dev/c/monogon/+/3829
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/build/analysis/BUILD.bazel b/build/analysis/BUILD.bazel
index 91a2f20..ae0cd74 100644
--- a/build/analysis/BUILD.bazel
+++ b/build/analysis/BUILD.bazel
@@ -196,6 +196,14 @@
             "cgo/": "cgo",
         },
     },
+    "haslicense": {
+        "exclude_files": {
+            "metropolis/node/kubernetes/metricsprovider": "Multi-Party copyright statement (#376)",
+            "external/": "third_party",
+            "bazel-out/": "generated_output",
+            "cgo/": "cgo",
+        },
+    },
 }
 
 # All analyzers that should be disabled for external, generated or cgo code.
@@ -215,7 +223,6 @@
     "hash",
     "errcmp",
     "gofmt",
-    "haslicense",
 ] + ALL_STATICCHECK_ANALYZERS
 
 # We override the variable with itself unioned with the other