owenthereal / upterm

Instant Terminal Sharing
https://upterm.dev
Apache License 2.0
838 stars 55 forks source link

feat: add session labels on connection metrics #202

Open bavarianbidi opened 12 months ago

bavarianbidi commented 12 months ago

to differenciate multiple running upterm host sessions via the metrics endpoint, new metrics will get the session_id label and a custom label.

This is an initial implementation to get a technical breakthrough to see how/if the desired feature request #194 could look like.

The current implementation will generate the following new metrics:

# HELP uptermd_upterm_host_current_clients Info about started upterm host session
# TYPE uptermd_upterm_host_current_clients gauge
uptermd_upterm_host_current_clients{controller="upterm",session_id="6Xugtn2fpoFEAxEXTkLr"} 1
uptermd_upterm_host_current_clients{controller="upterm",session_id="lcMJta3WHPyOhGxbWClH"} 2
# HELP uptermd_upterm_host_info Info about started upterm host session
# TYPE uptermd_upterm_host_info gauge
uptermd_upterm_host_info{controller="upterm",label="this-is-my-custom/hostname",session_id="6Xugtn2fpoFEAxEXTkLr"} 1
uptermd_upterm_host_info{controller="upterm",label="clx082456336.company.domain.net",session_id="lcMJta3WHPyOhGxbWClH"} 1

following upterm host commands are run to generate the metrics:

To be discussed:

bavarianbidi commented 10 months ago

@owenthereal friendly reminder on my questions in this PR ;-)

i'm also happy to chat/explain our current usage of upterm with you. Maybe that might help to at least understand the origin of some of our PRs/Issues.