owenthereal / upterm

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

source labels on metrics #194

Open bavarianbidi opened 1 year ago

bavarianbidi commented 1 year ago

As a uptermd operator i want to get the possibility to view the different origins of the upterm host command. For that i've thought about adding an optional flag where it's possible to define a custom string/tag. This information will also get propagated to the uptermd component and used as an additional tag: value on the generated metrics.

With that it should be possible to "aggregate" the metrics by different tags, e.g.:

upterm_uptermd_routing_active_connections_count{tag="dynamic/runner"} 1
upterm_uptermd_routing_active_connections_count{tag="hostname7744"} 1

and the corresponding upterm host command could look like upterm host --tag "dynamic/runner". And if no --tag is defined, the current HOSTNAME will be used.