Skip to content

feat: ssh server metrics#19526

Merged
jujubot merged 1 commit intojuju:feature/sshfrom
kian99:ssh-server-metrics
Apr 17, 2025
Merged

feat: ssh server metrics#19526
jujubot merged 1 commit intojuju:feature/sshfrom
kian99:ssh-server-metrics

Conversation

@kian99
Copy link
Contributor

@kian99 kian99 commented Apr 15, 2025

This PR adds metrics to the SSH server for 4 initial measurements:

  • Connection count
  • Time to session
  • Session Duration
  • Authentication failures

The metrics are in Prometheus style format and follows a similar pattern to other workers.

Checklist

  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • doc.go added or updated in changed packages

Links

Jira card: JUJU-7778

@hpidcock
Copy link
Member

/build

@kian99 kian99 force-pushed the ssh-server-metrics branch from b77dc4a to 053912f Compare April 16, 2025 08:21
@kian99
Copy link
Contributor Author

kian99 commented Apr 16, 2025

/build

Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good with a request and a question

Namespace: metricsNamespace,
Name: "session_time",
Help: "The duration a user keeps an SSH session open.",
Buckets: []float64{1, 10, 60, 300, 600, 3600},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a label to differentiate between k8s and machine session would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be more relevant to the time-to-session one, but I'll add it to both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added it to the timeToSession metric but it's a bit hard to add the model type to this one so I've left it for now.

@kian99 kian99 force-pushed the ssh-server-metrics branch from 053912f to 4387a58 Compare April 16, 2025 15:27
Copy link
Contributor

@SimoneDutto SimoneDutto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

This PR adds metrics for 4 initial measurements:
- Connection count
- Time to session
- Session Duration
- Authentication failures
@kian99 kian99 force-pushed the ssh-server-metrics branch from 4387a58 to 53b2af1 Compare April 16, 2025 15:40
@kian99
Copy link
Contributor Author

kian99 commented Apr 17, 2025

/build

@kian99
Copy link
Contributor Author

kian99 commented Apr 17, 2025

/merge

@jujubot jujubot merged commit c494c55 into juju:feature/ssh Apr 17, 2025
25 of 26 checks passed
@kian99 kian99 deleted the ssh-server-metrics branch May 2, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments