Question:
You are writing a bash script that will write metrics that are ultimately ingested via the Node Exporter’s textfile collector. You want to add a metric that tracks the number of users currently logged into your server.
Which of the following metric names, types and labels is the MOST appropriate for this use case?
Name: users_logged_in
Type: Gauge
Labels: None
Name: user_last_login_timestamp
Type: Counter
Labels: username
Name: users_logged_in
Type: Gauge
Labels: last_login_timestamp
Name: user_last_login_timestamp
Type: Gauge
Labels: username