Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add session labels on connection metrics #202

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bavarianbidi
Copy link
Contributor

@bavarianbidi bavarianbidi commented Oct 11, 2023

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:

  • don't define a custom label*
    the os.getHostname will be used as custom label
make build && ./build/upterm host --accept --server ssh://localhost:2222 -- docker run --rm -ti ubuntu bash
  • overwrite the discovered hostname*
make build && ./build/upterm host --accept --server ssh://localhost:2222 --label "this-is-my-custom/hostname" -- docker run --rm -ti ubuntu bash

To be discussed:

  • Is this something you might accept @owenthereal
  • define better metric names
  • how to deal with the already existing metrics? should we re-use upterm_uptermd_routing_active_connections_count and
    upterm_uptermd_routing_connections_count

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

Signed-off-by: Mario Constanti <[email protected]>
@bavarianbidi
Copy link
Contributor Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant