28. • Go
• Java
• Python
• Ruby
• Bash
Prometheus. Приложения.
1. cpuTemp = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "cpu_temperature_celsius",
Help: "Current temperature of the CPU.”
})
2. prometheus.MustRegister(cpuTemp)
3. cpuTemp.Set(65.3)
4. http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(":8080", nil))
29. • Top5 docker containers by cpu
• topk(3, sum(rate(container_cpu_system_seconds_total[5m])) by (name))
• RPS for site across all nginx nodes
• sum(irate(nginx_server_requests{host="*"}[5m]))
• Predict used space in some time
• predict_linear(node_filesystem_free{}[1h], 3600)
Prometheus. PromQL.