1
0
mirror of https://github.com/minio/docs.git synced 2025-04-19 21:02:14 +03:00
docs/sync-minio-server-docs.sh
Andrea Longo 343e54d402
Metrics v3 (#1289)
Add metrics v3 to the Metrics and Alerts page and other relevant
locations, deprecate metrics v2.

- Updated the metrics extract script to parse the [list of v3 metrics
from
GitHub](https://github.com/minio/minio/blob/master/docs/metrics/v3.md).
- Remove references to MinIO Console metrics.
- Make `:mc-release:` show friendly release name text like
`:minio-release:` does.

Staged:

Linux

http://192.241.195.202:9000/staging/DOCS-1266/linux/operations/monitoring/metrics-and-alerts.html

k8s

http://192.241.195.202:9000/staging/DOCS-1266/k8s/operations/monitoring/metrics-and-alerts.html

fixes https://github.com/minio/docs/issues/1266
2024-08-02 17:58:59 -06:00

75 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
set -e
set -x
function main() {
# Extract metrics v2 list
curl --retry 10 -Ls https://raw.githubusercontent.com/minio/minio/master/docs/metrics/prometheus/list.md | csplit - /"# Bucket Metrics"/
mv xx00 source/includes/common-metrics-cluster.md
# Kludgy. Does csplit again on the Bucket Metrics file fragment
# Tried to get smart using `grep '^# [A-Za-z]` to get line numbers but got stuck
cat xx01 | csplit - /"# Resource Metrics"/
mv xx00 source/includes/common-metrics-bucket.md
mv xx01 source/includes/common-metrics-resource.md
# Extract metrics v3 list
# Get the full list
curl --retry 10 -Ls https://raw.githubusercontent.com/minio/minio/master/docs/metrics/v3.md | csplit - /"## Metric Categories"/
# Ignore xx00, contains intro text
# Overwritten in second csplit anyway
# Split remainder of file into categories by H3
# Number of times to match must be exact
cat xx01 | csplit - /"^### "/ '{9}'
# Copy each category into an include file
# Order below must match section order in source file
# Ignore xx00 again, more intro text
rm xx00
# API (Renamed from Request)
# Hopefully ex works the same on both Mac and Linux, unlike sed
ex -sc '%s/### Request metrics/### API metrics/' -c 'x' xx01
mv xx01 source/includes/common-metrics-v3-api.md
# Audit
mv xx02 source/includes/common-metrics-v3-audit.md
# Cluster
mv xx03 source/includes/common-metrics-v3-cluster.md
# Debug
mv xx04 source/includes/common-metrics-v3-debug.md
# ILM
mv xx05 source/includes/common-metrics-v3-ilm.md
# Logger Webhook
mv xx06 source/includes/common-metrics-v3-logger-webhook.md
# Notification
mv xx07 source/includes/common-metrics-v3-notification.md
# Replication
mv xx08 source/includes/common-metrics-v3-replication.md
# Scanner
mv xx09 source/includes/common-metrics-v3-scanner.md
# System
mv xx10 source/includes/common-metrics-v3-system.md
}
main "$@"