modules/prometheus: add basic auth

This commit is contained in:
xinyangli 2024-11-30 17:35:46 +08:00
parent 97fcdefc2b
commit 74b67e1854
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
10 changed files with 184 additions and 194 deletions

View file

@ -7,6 +7,7 @@ in
{
name,
address,
passwordFile ? null,
port ? 443,
scheme ? "https",
...
@ -16,6 +17,15 @@ in
scheme = scheme;
static_configs = [ { targets = [ "${address}${mkPort port}" ]; } ];
}
// (
if isNull null then
{ }
else
{
basic_auth.username = "prom";
basic_auth.password_file = passwordFile;
}
)
);
mkCaddyScrapes = mkFunction (