Skip to content
Snippets Groups Projects
Commit 36e20ebb authored by Leonidas Spyropoulos's avatar Leonidas Spyropoulos
Browse files

Merge branch 'goaurrpc_metrics' into 'master'

aurweb: enable goaurrpc metrics

See merge request !640
parents 7d5a2a77 87b2eddf
No related branches found
No related tags found
1 merge request!640aurweb: enable goaurrpc metrics
Pipeline #34815 passed
$ANSIBLE_VAULT;1.1;AES256
64356530383261396436353036356166656231363964356266313061393935636365353931333632
3566333830343965653766316236633563353662633031610a663030643166313432336337346430
35326662346566383630653433633230613665333264313036303038663063366561636466633635
6131656134333232640a386363643834383363643665343333653531653231346565393764366137
35303637316530623136373838626536373265633836623937326234353133383235646461343635
31346335353939333532336463616130323338316236376163383033313134323133333539613139
623764623337366432393537353733613538
......@@ -233,7 +233,7 @@
domains: ["{{ aurweb_domain }}"]
- name: Set up nginx
template: src=nginx.d.conf.j2 dest={{ aurweb_nginx_conf }} owner=root group=root mode=644
template: src=nginx.d.conf.j2 dest={{ aurweb_nginx_conf }} owner=root group=http mode=640
notify: Reload nginx
tags: ['nginx']
......
......@@ -16,5 +16,6 @@
"KeyFile": "",
"EnableSearchCache": true,
"CacheCleanupInterval": 60,
"CacheExpirationTime": 180
"CacheExpirationTime": 180,
"EnableMetrics": true
}
......@@ -118,6 +118,15 @@ server {
proxy_set_header X-Forwarded-For $remote_addr;
}
location /rpc/metrics {
if ($http_authorization != "Bearer {{ vault_goaurrpc_metrics_token }}") {
return 403;
}
proxy_pass http://127.0.0.1:10666/metrics;
proxy_set_header X-Forwarded-For $remote_addr;
}
location / {
# Proxy over to aurweb's ASGI application.
proxy_pass http://{{ aurweb_asgi_bind }};
......
{
"__inputs": [
{
"name": "DS_GOAURRPC",
"label": "goaurrpc",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": ""
},
{
"type": "panel",
"id": "piechart",
"name": "Pie chart",
"version": ""
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "/rpc metrics",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byFrameRefID",
"options": "requests_rate_limited"
},
"properties": [
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
}
]
}
}
]
},
{
"matcher": {
"id": "byFrameRefID",
"options": "last_refresh"
},
"properties": [
{
"id": "unit",
"value": "dateTimeAsIsoNoDateIfToday"
}
]
}
]
},
"gridPos": {
"h": 7,
"w": 6,
"x": 0,
"y": 0
},
"id": 14,
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "rpc_data_last_refresh * 1000",
"hide": false,
"legendFormat": "Last metadata refresh",
"range": true,
"refId": "last_refresh"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum(rpc_requests)",
"hide": false,
"legendFormat": "Requests served",
"range": true,
"refId": "requests"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum(rpc_requests_rate_limited)",
"legendFormat": "Requests rate-limited",
"range": true,
"refId": "requests_rate_limited"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "rpc_cache_hits",
"hide": false,
"legendFormat": "Cache hits",
"range": true,
"refId": "A"
}
],
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 5,
"x": 6,
"y": 0
},
"id": 22,
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum by(type) (rpc_requests)",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Total Requests by type",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineStyle": {
"fill": "solid"
},
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 7,
"w": 13,
"x": 11,
"y": 0
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "go_memstats_heap_alloc_bytes{job=\"goaurrpc\"}",
"legendFormat": "HEAP",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "process_resident_memory_bytes{job=\"goaurrpc\"}",
"hide": false,
"legendFormat": "RSS",
"range": true,
"refId": "B"
}
],
"title": "Memory usage",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "normal"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 7
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum by(type) (rate(rpc_requests[5m]))",
"legendFormat": "{{type}}",
"range": true,
"refId": "A"
}
],
"title": "Requests per second by type",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 12
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "asc"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"exemplar": false,
"expr": "sum by(by) (rate(rpc_requests{type=\"search\"}[5m]))",
"instant": false,
"legendFormat": "{{by}}",
"range": true,
"refId": "A"
}
],
"title": "Search requests per second",
"transformations": [],
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 17
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "histogram_quantile(0.95, sum by(le) (rate(rpc_request_duration_seconds_bucket[5m])))",
"legendFormat": "quantile95",
"range": true,
"refId": "quantile95"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "histogram_quantile(0.5, sum by(le) (rate(rpc_request_duration_seconds_bucket[5m])))",
"hide": false,
"legendFormat": "quantile50",
"range": true,
"refId": "quantile50"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "rate(rpc_request_duration_seconds_sum[5m]) / rate(rpc_request_duration_seconds_count[5m])",
"hide": false,
"legendFormat": "average",
"range": true,
"refId": "average"
}
],
"title": "Request duration",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "smooth",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 22
},
"id": 16,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "Prometheus"
},
"editorMode": "builder",
"expr": "sum(rate(rpc_response_size_bytes_sum[5m])) / sum(rate(rpc_response_size_bytes_count[5m]))",
"legendFormat": "average",
"range": true,
"refId": "average"
}
],
"title": "Response size",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "goaurrpc",
"uid": "mGJE0LS4z",
"version": 1,
"weekStart": ""
}
\ No newline at end of file
../dashboards/goaurrpc.json
\ No newline at end of file
......@@ -8,6 +8,8 @@ prometheus_remote_write_relabel_configs:
regex: debuginfod
- label: job
regex: aurweb
- label: job
regex: goaurrpc
- label: __name__
regex: "archive_directory_size_bytes|archive_total_packages|rebuilderd_results|rebuilderd_workers|rebuilderd_queue_length|repository_directory_size_bytes|aur_.+"
......
......@@ -137,6 +137,14 @@ scrape_configs:
static_configs:
- targets: ['aur.archlinux.org:443']
- job_name: goaurrpc
metrics_path: /rpc/metrics
scheme: https
authorization:
credentials: {{ vault_goaurrpc_metrics_token }}
static_configs:
- targets: ['aur.archlinux.org:443']
- job_name: grafana
scheme: https
authorization:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment