this repo has no description
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(wolumonde): perses dashboard as code with go

dusk 5d712a59 0185858b

+625 -24
+1
.gitignore
··· 12 12 ssh_key 13 13 secrets/deploy-webhook.nu 14 14 15 + # dnscontrol 15 16 creds.json
+2
deploy.nu
··· 5 5 6 6 path add /nix/var/nix/profiles/default/bin 7 7 8 + cd $env.FLAKE 9 + 8 10 # load webhook secrets 9 11 rage -d -i ./ssh_key ./secrets/deployWebhook.age | from toml | load-env 10 12
+4 -1
hosts/wolumonde/default.nix
··· 10 10 # inputs.nixtopo.nixosModules.default 11 11 ] ++ (tlib.importFolder (toString ./modules)); 12 12 13 - environment.systemPackages = [ pkgs.magic-wormhole-rs ]; 13 + environment.systemPackages = with pkgs; [ 14 + magic-wormhole-rs 15 + systemctl-tui 16 + ]; 14 17 15 18 boot.tmp.cleanOnBoot = true; 16 19 zramSwap.enable = true;
+14 -6
hosts/wolumonde/modules/nginx.nix
··· 31 31 '"req.headers.id":"$request_id",' 32 32 '"req.headers.referer":"$http_referer",' 33 33 '"req.headers.user-agent":"$http_user_agent",' 34 - '"responseTime":$request_time' 34 + '"requestTime":$request_time' 35 35 '}'; 36 36 access_log /var/log/nginx/access.log json_logs; 37 37 ''; ··· 89 89 parser = "nginx_json"; 90 90 } 91 91 ]; 92 + filters = [ 93 + { 94 + name = "modify"; 95 + match = "logs.nginx"; 96 + Add = [ "name nginx" ]; 97 + } 98 + ]; 92 99 }; 93 100 }; 94 101 ··· 103 110 rules = [ 104 111 { 105 112 record = "nginx_request_count"; 106 - expr = "* | stats count() as requests"; 113 + expr = "name:nginx | stats count(*) as req"; 107 114 } 108 115 { 109 116 record = "nginx_2xx_count"; 110 - expr = ''* | res.statusCode:~"2.." | stats count() as successes''; 117 + expr = ''name:nginx | res.statusCode:~"2.." | stats count(*) as success''; 111 118 } 112 119 { 113 120 record = "nginx_5xx_count"; 114 - expr = ''* | res.statusCode:~"5.." | stats count() as errors''; 121 + expr = ''name:nginx | res.statusCode:~"5.." | stats count(*) as error''; 115 122 } 116 123 { 117 - record = "nginx_request_latency_avg"; 118 - expr = "* | stats avg(responseTime) as avg_latency"; 124 + record = "nginx_request_latency"; 125 + # filter out subscribeRepos requests because they are long polling http L 126 + expr = "name:nginx | filter req.url:!/xrpc/com.atproto.sync.subscribeRepos | stats avg(requestTime) avg, quantile(0.5, requestTime) p50, quantile(0.9, requestTime) p90, quantile(0.99, requestTime) p99"; 119 127 } 120 128 ]; 121 129 }
+22
hosts/wolumonde/modules/pds.nix
··· 73 73 }; 74 74 }; 75 75 76 + services.vmalert.rules.groups = [ 77 + { 78 + name = "pds-logs"; 79 + type = "vlogs"; 80 + interval = "1m"; 81 + rules = [ 82 + { 83 + record = "pds_request_count"; 84 + expr = "name:pds | stats count(*) as requests"; 85 + } 86 + { 87 + record = "pds_5xx_count"; 88 + expr = ''name:pds | res.statusCode:~"5.." | stats count(*) as errors''; 89 + } 90 + { 91 + record = "pds_response_latency"; 92 + expr = "name:pds | stats avg(responseTime) avg, quantile(0.5, responseTime) p50, quantile(0.9, responseTime) p90, quantile(0.99, responseTime) p99"; 93 + } 94 + ]; 95 + } 96 + ]; 97 + 76 98 # virtualisation = { 77 99 # podman = { 78 100 # enable = true;
+24 -13
hosts/wolumonde/modules/perses.nix
··· 4 4 port = 7412; 5 5 user = "perses"; 6 6 7 + provisionFolder = "provisioning"; 8 + 9 + persesConfig = { 10 + database.file = { 11 + folder = "/perses"; 12 + extension = "json"; 13 + }; 14 + provisioning.folders = [ "/perses/${provisionFolder}" ]; 15 + security = { 16 + enable_auth = true; 17 + authentication = { 18 + providers.enable_native = true; 19 + disable_sign_up = true; 20 + }; 21 + cookie = { 22 + same_site = "strict"; 23 + secure = true; 24 + }; 25 + }; 26 + }; 27 + persesConfigYaml = pkgs.writers.writeYAML "config.yaml" persesConfig; 28 + 7 29 persesImage = pkgs.dockerTools.pullImage { 8 30 imageName = "docker.io/persesdev/perses"; 9 31 imageDigest = "sha256:7d4647ce31841f67c2361bd10ea344de1edd7fbf65711c75805a5aacdc7735d0"; ··· 16 38 contents = [ pkgs.curl ]; 17 39 config.Entrypoint = [ "/bin/perses" ]; 18 40 config.Cmd = [ 19 - "--config=/etc/perses/config.yaml" 41 + "--config=${persesConfigYaml}" 20 42 "--log.level=info" 21 43 "--web.listen-address=:${toString port}" 22 44 # "--log.method-trace" ··· 32 54 33 55 persesEnv = config.virtualisation.oci-containers.containers.perses.environment; 34 56 secrets = config.age.secrets; 35 - provisionFolder = "provisioning"; 36 57 in 37 58 { 38 59 environment.systemPackages = [ pkgs.percli ]; ··· 79 100 sdnotify = "healthy"; 80 101 }; 81 102 environmentFiles = [ secrets.persesSecret.path ]; 82 - environment = { 83 - PERSES_SECURITY_AUTHENTICATION_PROVIDERS_ENABLE_NATIVE = "true"; 84 - PERSES_SECURITY_AUTHENTICATION_DISABLE_SIGN_UP = "true"; 85 - PERSES_SECURITY_ENABLE_AUTH = "true"; 86 - PERSES_SECURITY_COOKIE_SAME_SITE = "strict"; 87 - PERSES_SECURITY_COOKIE_SECURE = "true"; 88 - PERSES_PROVISIONING_FOLDERS_0 = "/perses/${provisionFolder}"; 89 - # PERSES_PROVISIONING_INTERVAL = "1m"; 90 - # PERSES_AUTHORIZATION_GUEST_PERMISSIONS_ACTIONS = "read"; 91 - }; 92 103 volumes = [ 93 - "/var/lib/perses:/perses" 104 + "/var/lib/perses:${persesConfig.database.file.folder}" 94 105 ]; 95 106 extraOptions = [ 96 107 "--network=host"
+2
hosts/wolumonde/modules/perses/dashboards/.gitignore
··· 1 + # folder used to store the results of the `percli dac build` command 2 + built
+28
hosts/wolumonde/modules/perses/dashboards/go.mod
··· 1 + module dash 2 + 3 + go 1.24.2 4 + 5 + require ( 6 + github.com/beorn7/perks v1.0.1 // indirect 7 + github.com/cespare/xxhash/v2 v2.3.0 // indirect 8 + github.com/go-jose/go-jose/v4 v4.0.5 // indirect 9 + github.com/jpillora/backoff v1.0.0 // indirect 10 + github.com/muhlemmer/gu v0.3.1 // indirect 11 + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 12 + github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect 13 + github.com/perses/perses v0.50.3 // indirect 14 + github.com/prometheus/client_golang v1.20.5 // indirect 15 + github.com/prometheus/client_model v0.6.1 // indirect 16 + github.com/prometheus/common v0.63.0 // indirect 17 + github.com/prometheus/procfs v0.15.1 // indirect 18 + github.com/zitadel/oidc/v3 v3.36.1 // indirect 19 + github.com/zitadel/schema v1.3.0 // indirect 20 + golang.org/x/crypto v0.36.0 // indirect 21 + golang.org/x/net v0.35.0 // indirect 22 + golang.org/x/oauth2 v0.28.0 // indirect 23 + golang.org/x/sys v0.31.0 // indirect 24 + golang.org/x/text v0.23.0 // indirect 25 + google.golang.org/protobuf v1.36.5 // indirect 26 + gopkg.in/yaml.v2 v2.4.0 // indirect 27 + gopkg.in/yaml.v3 v3.0.1 // indirect 28 + )
+45
hosts/wolumonde/modules/perses/dashboards/go.sum
··· 1 + github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 2 + github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= 3 + github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= 4 + github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 5 + github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= 6 + github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= 7 + github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= 8 + github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= 9 + github.com/muhlemmer/gu v0.3.1 h1:7EAqmFrW7n3hETvuAdmFmn4hS8W+z3LgKtrnow+YzNM= 10 + github.com/muhlemmer/gu v0.3.1/go.mod h1:YHtHR+gxM+bKEIIs7Hmi9sPT3ZDUvTN/i88wQpZkrdM= 11 + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= 12 + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 13 + github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= 14 + github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 15 + github.com/perses/perses v0.50.3 h1:BHlU9qkCFCUSP4HP5p9GwophWcxm5Vnu6Fsrx8Fb/+w= 16 + github.com/perses/perses v0.50.3/go.mod h1:oqfHLOrXERvEqECShqXPjHXqVukQxcoaaTM6ySRF7hU= 17 + github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= 18 + github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= 19 + github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= 20 + github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= 21 + github.com/prometheus/common v0.63.0 h1:YR/EIY1o3mEFP/kZCD7iDMnLPlGyuU2Gb3HIcXnA98k= 22 + github.com/prometheus/common v0.63.0/go.mod h1:VVFF/fBIoToEnWRVkYoXEkq3R3paCoxG9PXP74SnV18= 23 + github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= 24 + github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= 25 + github.com/zitadel/oidc/v3 v3.36.1 h1:1AT1NqKKEqAwx4GmKJZ9fYkWH2WIn/VKMfQ46nBtRf0= 26 + github.com/zitadel/oidc/v3 v3.36.1/go.mod h1:dApGZLvWZTHRuxmcbQlW5d2XVjVYR3vGOdq536igmTs= 27 + github.com/zitadel/schema v1.3.0 h1:kQ9W9tvIwZICCKWcMvCEweXET1OcOyGEuFbHs4o5kg0= 28 + github.com/zitadel/schema v1.3.0/go.mod h1:NptN6mkBDFvERUCvZHlvWmmME+gmZ44xzwRXwhzsbtc= 29 + golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= 30 + golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= 31 + golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= 32 + golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= 33 + golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= 34 + golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= 35 + golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= 36 + golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 37 + golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= 38 + golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= 39 + google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= 40 + google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 41 + gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 42 + gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 43 + gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 44 + gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 45 + gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+192
hosts/wolumonde/modules/perses/dashboards/wolumonde.go
··· 1 + package main 2 + 3 + import ( 4 + "flag" 5 + "time" 6 + 7 + "github.com/perses/perses/go-sdk" 8 + "github.com/perses/perses/go-sdk/common" 9 + dash "github.com/perses/perses/go-sdk/dashboard" 10 + "github.com/perses/perses/go-sdk/panel" 11 + panels "github.com/perses/perses/go-sdk/panel-group" 12 + "github.com/perses/perses/go-sdk/panel/bar" 13 + "github.com/perses/perses/go-sdk/prometheus/query" 14 + 15 + timeSeries "github.com/perses/perses/go-sdk/panel/time-series" 16 + // promDs "github.com/perses/perses/go-sdk/prometheus/datasource" 17 + ) 18 + 19 + func main() { 20 + flag.Parse() 21 + exec := sdk.NewExec() 22 + var loadPanel = panels.AddPanel("load over 5 min", 23 + timeSeries.Chart(), 24 + panel.AddQuery( 25 + query.PromQL( 26 + "node_load5", 27 + query.SeriesNameFormat("load"), 28 + ), 29 + ), 30 + ) 31 + var memoryPanel = panels.AddPanel("memory usage", 32 + timeSeries.Chart( 33 + timeSeries.WithYAxis( 34 + timeSeries.YAxis{ 35 + Format: &common.Format{ 36 + Unit: "bytes", 37 + }, 38 + Max: 4000000000, 39 + }, 40 + ), 41 + ), 42 + panel.AddQuery( 43 + query.PromQL( 44 + "node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes", 45 + query.SeriesNameFormat("current memory usage"), 46 + ), 47 + ), 48 + ) 49 + var resPanels = dash.AddPanelGroup("resource usage", 50 + panels.PanelsPerLine(4), 51 + loadPanel, memoryPanel, 52 + ) 53 + 54 + var nginxPanel = panels.AddPanel("nginx requests / min", 55 + timeSeries.Chart( 56 + timeSeries.WithQuerySettings( 57 + []timeSeries.QuerySettingsItem{ 58 + { 59 + QueryIndex: 0, 60 + ColorMode: timeSeries.FixedMode, 61 + ColorValue: "#FF0000", 62 + }, 63 + }, 64 + ), 65 + timeSeries.WithYAxis( 66 + timeSeries.YAxis{ 67 + Format: &common.Format{ 68 + Unit: "decimal", 69 + }, 70 + }, 71 + ), 72 + ), 73 + panel.AddQuery( 74 + query.PromQL( 75 + "nginx_5xx_count", 76 + query.SeriesNameFormat("5xx errors"), 77 + ), 78 + ), 79 + panel.AddQuery( 80 + query.PromQL( 81 + "nginx_request_count", 82 + query.SeriesNameFormat("requests"), 83 + ), 84 + ), 85 + ) 86 + 87 + var nginxLatencyPanel = panels.AddPanel("nginx latency / min", 88 + timeSeries.Chart( 89 + timeSeries.WithYAxis( 90 + timeSeries.YAxis{ 91 + Format: &common.Format{ 92 + Unit: "seconds", 93 + }, 94 + Max: 1.0, 95 + }, 96 + ), 97 + ), 98 + panel.AddQuery( 99 + query.PromQL( 100 + "nginx_request_latency", 101 + query.SeriesNameFormat("{{stats_result}}"), 102 + ), 103 + ), 104 + ) 105 + 106 + var nginxPanels = dash.AddPanelGroup("nginx metrics", 107 + panels.PanelsPerLine(3), 108 + nginxPanel, 109 + nginxLatencyPanel, 110 + ) 111 + 112 + var pdsPanel = panels.AddPanel("pds requests / min", 113 + timeSeries.Chart( 114 + timeSeries.WithQuerySettings( 115 + []timeSeries.QuerySettingsItem{ 116 + { 117 + QueryIndex: 0, 118 + ColorMode: timeSeries.FixedMode, 119 + ColorValue: "#FF0000", 120 + }, 121 + }, 122 + ), 123 + timeSeries.WithYAxis( 124 + timeSeries.YAxis{ 125 + Format: &common.Format{ 126 + Unit: "decimal", 127 + }, 128 + }, 129 + ), 130 + ), 131 + panel.AddQuery( 132 + query.PromQL( 133 + "pds_5xx_count", 134 + query.SeriesNameFormat("5xx errors"), 135 + ), 136 + ), 137 + panel.AddQuery( 138 + query.PromQL( 139 + "pds_request_count", 140 + query.SeriesNameFormat("requests"), 141 + ), 142 + ), 143 + ) 144 + 145 + var pdsLatencyPanel = panels.AddPanel("pds latency / min", 146 + timeSeries.Chart( 147 + timeSeries.WithYAxis( 148 + timeSeries.YAxis{ 149 + Format: &common.Format{ 150 + Unit: "milliseconds", 151 + }, 152 + Max: 1000, 153 + }, 154 + ), 155 + ), 156 + panel.AddQuery( 157 + query.PromQL( 158 + "pds_response_latency", 159 + query.SeriesNameFormat("{{stats_result}}"), 160 + ), 161 + ), 162 + ) 163 + 164 + var pdsPanels = dash.AddPanelGroup("pds metrics", 165 + panels.PanelsPerLine(3), 166 + pdsPanel, 167 + pdsLatencyPanel, 168 + ) 169 + 170 + var anubisForgejoPanel = panels.AddPanel("anubis policy actions", 171 + bar.Chart(), 172 + panel.AddQuery( 173 + query.PromQL( 174 + "anubis_policy_results", 175 + query.SeriesNameFormat("{{action}}: {{rule}}"), 176 + ), 177 + ), 178 + ) 179 + 180 + var forgejoPanels = dash.AddPanelGroup("forgejo", 181 + panels.PanelsPerLine(3), 182 + anubisForgejoPanel, 183 + ) 184 + 185 + builder, buildErr := dash.New("wolumonde", 186 + dash.ProjectName("private-infra"), 187 + dash.Duration(30*time.Minute), 188 + dash.RefreshInterval(time.Minute), 189 + resPanels, nginxPanels, pdsPanels, forgejoPanels, 190 + ) 191 + exec.BuildDashboard(builder, buildErr) 192 + }
+3
hosts/wolumonde/modules/perses/provision/1-private-infra.yaml
··· 1 + kind: Project 2 + metadata: 3 + name: private-infra
hosts/wolumonde/modules/perses/provision/10-victoria.yaml hosts/wolumonde/modules/perses/provision/4-victoria.yaml
+11
hosts/wolumonde/modules/perses/provision/5-funny.yaml
··· 1 + { 2 + "kind": "User", 3 + "metadata": { 4 + "name": "cat" 5 + }, 6 + "spec": { 7 + "nativeProvider": { 8 + "password": "ziplocballs" 9 + } 10 + } 11 + }
+12
hosts/wolumonde/modules/perses/provision/6-guest-role.yaml
··· 1 + - kind: GlobalRole 2 + metadata: 3 + name: guest 4 + spec: 5 + permissions: 6 + - actions: 7 + - 'read' 8 + scopes: 9 + - 'Dashboard' 10 + - 'Project' 11 + - 'Datasource' 12 + - 'GlobalDatasource'
+8
hosts/wolumonde/modules/perses/provision/7-funny-bind-role.yaml
··· 1 + - kind: GlobalRoleBinding 2 + metadata: 3 + name: cat 4 + spec: 5 + role: guest 6 + subjects: 7 + - kind: User 8 + name: cat
+227
hosts/wolumonde/modules/perses/provision/90-wolumonde.yaml
··· 1 + kind: Dashboard 2 + metadata: 3 + name: wolumonde 4 + createdAt: 0001-01-01T00:00:00Z 5 + updatedAt: 0001-01-01T00:00:00Z 6 + version: 0 7 + project: private-infra 8 + spec: 9 + panels: 10 + "0_0": 11 + kind: Panel 12 + spec: 13 + display: 14 + name: load over 5 min 15 + plugin: 16 + kind: TimeSeriesChart 17 + spec: {} 18 + queries: 19 + - kind: TimeSeriesQuery 20 + spec: 21 + plugin: 22 + kind: PrometheusTimeSeriesQuery 23 + spec: 24 + query: node_load5 25 + seriesNameFormat: load 26 + "0_1": 27 + kind: Panel 28 + spec: 29 + display: 30 + name: memory usage 31 + plugin: 32 + kind: TimeSeriesChart 33 + spec: 34 + yAxis: 35 + format: 36 + unit: bytes 37 + max: 4e+09 38 + queries: 39 + - kind: TimeSeriesQuery 40 + spec: 41 + plugin: 42 + kind: PrometheusTimeSeriesQuery 43 + spec: 44 + query: node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes 45 + seriesNameFormat: current memory usage 46 + "1_0": 47 + kind: Panel 48 + spec: 49 + display: 50 + name: nginx requests / min 51 + plugin: 52 + kind: TimeSeriesChart 53 + spec: 54 + yAxis: 55 + format: 56 + unit: decimal 57 + querySettings: 58 + - queryIndex: 0 59 + colorMode: fixed 60 + colorValue: '#FF0000' 61 + queries: 62 + - kind: TimeSeriesQuery 63 + spec: 64 + plugin: 65 + kind: PrometheusTimeSeriesQuery 66 + spec: 67 + query: nginx_5xx_count 68 + seriesNameFormat: 5xx errors 69 + - kind: TimeSeriesQuery 70 + spec: 71 + plugin: 72 + kind: PrometheusTimeSeriesQuery 73 + spec: 74 + query: nginx_request_count 75 + seriesNameFormat: requests 76 + "1_1": 77 + kind: Panel 78 + spec: 79 + display: 80 + name: nginx latency / min 81 + plugin: 82 + kind: TimeSeriesChart 83 + spec: 84 + yAxis: 85 + format: 86 + unit: seconds 87 + max: 1 88 + queries: 89 + - kind: TimeSeriesQuery 90 + spec: 91 + plugin: 92 + kind: PrometheusTimeSeriesQuery 93 + spec: 94 + query: nginx_request_latency 95 + seriesNameFormat: '{{stats_result}}' 96 + "2_0": 97 + kind: Panel 98 + spec: 99 + display: 100 + name: pds requests / min 101 + plugin: 102 + kind: TimeSeriesChart 103 + spec: 104 + yAxis: 105 + format: 106 + unit: decimal 107 + querySettings: 108 + - queryIndex: 0 109 + colorMode: fixed 110 + colorValue: '#FF0000' 111 + queries: 112 + - kind: TimeSeriesQuery 113 + spec: 114 + plugin: 115 + kind: PrometheusTimeSeriesQuery 116 + spec: 117 + query: pds_5xx_count 118 + seriesNameFormat: 5xx errors 119 + - kind: TimeSeriesQuery 120 + spec: 121 + plugin: 122 + kind: PrometheusTimeSeriesQuery 123 + spec: 124 + query: pds_request_count 125 + seriesNameFormat: requests 126 + "2_1": 127 + kind: Panel 128 + spec: 129 + display: 130 + name: pds latency / min 131 + plugin: 132 + kind: TimeSeriesChart 133 + spec: 134 + yAxis: 135 + format: 136 + unit: milliseconds 137 + max: 1000 138 + queries: 139 + - kind: TimeSeriesQuery 140 + spec: 141 + plugin: 142 + kind: PrometheusTimeSeriesQuery 143 + spec: 144 + query: pds_response_latency 145 + seriesNameFormat: '{{stats_result}}' 146 + "3_0": 147 + kind: Panel 148 + spec: 149 + display: 150 + name: anubis policy actions 151 + plugin: 152 + kind: BarChart 153 + spec: 154 + calculation: last 155 + queries: 156 + - kind: TimeSeriesQuery 157 + spec: 158 + plugin: 159 + kind: PrometheusTimeSeriesQuery 160 + spec: 161 + query: anubis_policy_results 162 + seriesNameFormat: '{{action}}: {{rule}}' 163 + layouts: 164 + - kind: Grid 165 + spec: 166 + display: 167 + title: resource usage 168 + items: 169 + - x: 0 170 + "y": 0 171 + width: 6 172 + height: 6 173 + content: 174 + $ref: '#/spec/panels/0_0' 175 + - x: 6 176 + "y": 0 177 + width: 6 178 + height: 6 179 + content: 180 + $ref: '#/spec/panels/0_1' 181 + - kind: Grid 182 + spec: 183 + display: 184 + title: nginx metrics 185 + items: 186 + - x: 0 187 + "y": 0 188 + width: 8 189 + height: 6 190 + content: 191 + $ref: '#/spec/panels/1_0' 192 + - x: 8 193 + "y": 0 194 + width: 8 195 + height: 6 196 + content: 197 + $ref: '#/spec/panels/1_1' 198 + - kind: Grid 199 + spec: 200 + display: 201 + title: pds metrics 202 + items: 203 + - x: 0 204 + "y": 0 205 + width: 8 206 + height: 6 207 + content: 208 + $ref: '#/spec/panels/2_0' 209 + - x: 8 210 + "y": 0 211 + width: 8 212 + height: 6 213 + content: 214 + $ref: '#/spec/panels/2_1' 215 + - kind: Grid 216 + spec: 217 + display: 218 + title: forgejo 219 + items: 220 + - x: 0 221 + "y": 0 222 + width: 8 223 + height: 6 224 + content: 225 + $ref: '#/spec/panels/3_0' 226 + duration: 30m 227 + refreshInterval: 1m
+4 -4
pkgs-set/pkgs/percli.nix
··· 5 5 }: 6 6 let 7 7 pname = "percli"; 8 - version = "0.51.0-beta.1"; 8 + version = "0.50.3"; 9 9 10 10 src = fetchFromGitHub { 11 11 owner = "perses"; 12 12 repo = "perses"; 13 13 tag = "v${version}"; 14 - hash = "sha256-tub9W9ZOv1CDaZb/4JPg98HhfBqpVDSBQ6GNR8fBJ1Y="; 14 + hash = "sha256-E8PTPit9QLPMlLvdx8rbw0BwC+ZqSMTHdfPJ4aE4dsw="; 15 15 }; 16 16 in 17 17 buildGoModule { 18 18 inherit pname version src; 19 19 20 - CGO_ENABLED = 0; 20 + env.CGO_ENABLED = 0; 21 21 22 22 subPackages = [ "cmd/percli" ]; 23 23 24 - vendorHash = "sha256-2qtyEIzMu3UIDbsqhpAJDVYr7WGmE6H3ngN74HaON04="; 24 + vendorHash = "sha256-yUqV6pBl6tyE4f4tBVN0DwgVFey+1btVpK7eiMKkwIY="; 25 25 }
+19
shells/dash.nu
··· 1 + def "main build" [file: path] { 2 + percli dac build -f ($file | path basename) 3 + glob ./built/* 4 + | enumerate 5 + | each { 6 + |f| mv -f $f.item ( 7 + $env.PWD 8 + | path join .. provision ( 9 + $f.item 10 + | path basename 11 + | str replace "_output.yaml" ".yaml" 12 + | $"9($f.index)-($in)" 13 + ) 14 + ) 15 + } 16 + rm ./built 17 + } 18 + 19 + def main [] {}
+7
shells/default.nix
··· 20 20 }; 21 21 commit = pkgs.writers.writeNuBin "commit" ../commit.nu; 22 22 deploy = pkgs.writers.writeNuBin "deploy" ../deploy.nu; 23 + dash = pkgs.writers.writeNuBin "dash" ./dash.nu; 23 24 in 24 25 { 25 26 default = mkNakedShell { ··· 31 32 treefmt 32 33 rage 33 34 nh 35 + percli 36 + go 37 + gopls 38 + # golangci-lint 39 + # golangci-lint-langserver 34 40 ]) 35 41 ++ [ 42 + dash 36 43 agenix-wrapped 37 44 commit 38 45 deploy