blob: 30dd687c53acdda23dd0241c8ca2f28d267c871f [file] [log] [blame]
Serge Bazanski363bf4f2020-08-24 21:00:56 +02001local cluster = import "lib/cluster.libsonnet";
2local global = import "lib/global.libsonnet";
3
4// Monitoring tiers set up on k0. See README for architectural background.
Sergiusz Bazanski2022ac22020-06-06 17:04:07 +02005
6{
Serge Bazanski363bf4f2020-08-24 21:00:56 +02007 local k0 = self,
8 local cfg = {
9 storageClasses+: {
10 prometheus: "waw-hdd-redundant-3",
11 victoria: "waw-hdd-redundant-3",
Serge Bazanski4f7caf82020-10-10 17:58:09 +020012 grafana: "waw-hdd-redundant-3",
Sergiusz Bazanski2022ac22020-06-06 17:04:07 +020013 },
14 },
Serge Bazanski363bf4f2020-08-24 21:00:56 +020015
16 // Cluster tier - prometheus.
17 cluster: cluster.Cluster("k0") {
18 cfg+: cfg {
19 username: "cluster-k0",
20 upstreams: [
21 { password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], remote: k0.global.internalIngestURL },
22 ],
23 },
24 },
25
26 // Global tier - victoria metrics.
27 global: global.Global("k0") {
28 cfg+: cfg {
Serge Bazanski4f7caf82020-10-10 17:58:09 +020029 oauth: {
30 clientId: "22659ba3-c8b2-4855-9553-f78884e0d743",
31 clientSecret: std.split(importstr "secrets/plain/global-oauth-client-secret", "\n")[0],
32 },
Serge Bazanski363bf4f2020-08-24 21:00:56 +020033 hosts: {
34 globalAPI: "monitoring-global-api.k0.hswaw.net",
Serge Bazanski4f7caf82020-10-10 17:58:09 +020035 globalDashboard: "monitoring-global-dashboard.k0.hswaw.net",
Serge Bazanski363bf4f2020-08-24 21:00:56 +020036 },
37 agents: [
38 // Ingestion from k0 cluster tier.
39 { username: k0.cluster.cfg.username, password: std.split(importstr "secrets/plain/global-agent-cluster-k0", "\n")[0], },
Serge Bazanski363bf4f2020-08-24 21:00:56 +020040 ],
Serge Bazanski4f7caf82020-10-10 17:58:09 +020041 loopbackGrafanaUser: {
42 username: "grafana",
43 password: std.split(importstr "secrets/plain/global-agent-grafana", "\n")[0],
44 },
Serge Bazanski363bf4f2020-08-24 21:00:56 +020045 },
46 },
Sergiusz Bazanski2022ac22020-06-06 17:04:07 +020047}