Junior — Middle
What methods can you use to obtain data about the status of services, besides using Prometheus?
sobes.tech AI
Answer from AI
Besides Prometheus, the following methods can be used to obtain service health data:
- Health Checks — special HTTP endpoints (e.g.,
/healthor/status) that services provide to check their status. - Logging and log analysis — collecting and analyzing logs using systems like ELK Stack (Elasticsearch, Logstash, Kibana) or Graylog.
- Distributed Tracing — tracing systems such as Jaeger or Zipkin help understand the state and performance of services.
- Metrics from other monitoring systems — for example, Zabbix, Nagios, Datadog, New Relic.
- Using gRPC or REST API to obtain metrics — if services provide an API for monitoring.
Example of a simple health check in Go:
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})