Skip to content

feat(coderd): add prometheus metrics to servertailnet #11988

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

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

coadler
Copy link
Contributor

@coadler coadler commented Feb 1, 2024

No description provided.

@coadler
Copy link
Contributor Author

coadler commented Feb 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @coadler and the rest of your teammates on Graphite Graphite

@coadler coadler requested a review from spikecurtis February 1, 2024 23:56
}

func (c *instrumentedConn) Close() error {
c.closeOnce.Do(func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

are network connections always explicitly closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one I'm not 100% sure on. Admittedly, I found this idea from a stackoverflow post which seemed to work for a couple other people. Was planning to get this into dev and monitor to make sure it works as intended with a lot more usage than I can reproduce myself.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess maybe they should be and this gauge will tell us if there's a leak...

connsPerAgent: prometheus.NewGauge(prometheus.GaugeOpts{
Namespace: "coder",
Subsystem: "servertailnet",
Name: "open_tcp_connections",
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize we only use servertailnet for HTTP proxying at present, but what do you think about changing this to open_connections and making the network a label (e.g. network=tcp? Like, I dunno, what if some customer wants us to proxy QUIC or some shit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's a good point. If we were to keep it like this we would definitely preclude ourselves from expanding this without a breaking change. Adding a network=tcp with it really only ever being tcp for the forseeable future basically has the same implications and usability as not having it, probably a good change.

@coadler coadler force-pushed the colin/featcoderdaddprometheusmetricstoservertailnet branch from 5f9a1d5 to 02a7089 Compare February 6, 2024 05:34
@coadler coadler merged commit c7f52b7 into main Feb 6, 2024
@coadler coadler deleted the colin/featcoderdaddprometheusmetricstoservertailnet branch February 6, 2024 05:57
@coadler
Copy link
Contributor Author

coadler commented Feb 6, 2024

Merge activity

@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants