Comments (8)
Digging a bit more… I don’t really speak Go but I’ll try… Clearly this function RemoveConnection is being called too much, or AddConnection not enough.
from traefik.
Errr, so something looks off to me, but probably is not. Reproducing the code of RemoveConnection here:
func (c *connectionTracker) RemoveConnection(conn net.Conn) {
c.connsMu.Lock()
delete(c.conns, conn)
c.connsMu.Unlock()
if c.openConnectionsGauge != nil {
c.openConnectionsGauge.Add(-1)
}
}
Is it normal that the Gauge decrementation is outside of the mutex section ? I guess the instrumentation library is threadsafe already, is it ?
from traefik.
@rtribotte I see that you authored this highly relevant commit 7c2af10 from PR #9656, might you be able to chip in ?
from traefik.
I have an issue too
my metrics:
HELP traefik_open_connections How many open connections exist, by entryPoint and protocol
TYPE traefik_open_connections gauge
traefik_open_connections{entrypoint="metrics",protocol="TCP"} 2
traefik_open_connections{entrypoint="traefik",protocol="TCP"} -26
traefik_open_connections{entrypoint="web",protocol="TCP"} -26
traefik_open_connections{entrypoint="websecure",protocol="TCP"} 8
from traefik.
Hello @navaati, thanks for opening this!
Is it normal that the Gauge decrementation is outside of the mutex section ? I guess the instrumentation library is threadsafe already, is it ?
It should be threadsafe indeed (https://github.com/prometheus/client_golang/blob/release-1.17/prometheus/gauge.go#L122C1-L130C2), Have you had a chance to try the alternative (protect with the mutex)? Did it fix the bug?
from traefik.
Hi.
No, I haven’t tested anything yet: I first need to figure out how to build the binary then the container, for which I haven’t found instructions yet (at least nothing in the contributing documentation). EDIT: found the doc https://doc.traefik.io/traefik/contributing/building-testing/ !
I’ll find and try to test, although with that link you dug I don’t have much hope. Is it actually the official prom client which is being used here though ? I see the type of the gauge is gokitmetrics.Gauge
.
from traefik.
Yeah no, it’s just an abstraction layer over the official prom client: https://github.com/go-kit/kit/blob/dfe43fa6a8d72c23e2205d0b80e762346e203f78/metrics/prometheus/prometheus.go#L84.
from traefik.
Related Issues (20)
- Traefik does not resolve TLS ingress if termination secret created after ingress HOT 1
- More resiliant approach for in-flight requests on terminating Pods HOT 5
- Service label in traefik_service_server_up metric is not human-readable HOT 4
- filter query params from logs HOT 1
- Dual Logging paths HOT 1
- rate limit middleware to support long latency requests HOT 1
- Log files not persisted on container restart HOT 2
- Cannot load rules / directives from config files HOT 9
- Can't upload docker images larger than 2GB via traefik 3.0 proxy HOT 8
- The final response code of my api service when using traefik error middleware is of main service ? - error service ? HOT 1
- provider=swarm - Gateway time-out Error code 504 HOT 1
- Kubernetes Ingress With Wildcard Host Doesn't Cover Hosts With Undescores (_) HOT 1
- Traefik V3 break on TCP Routers filter HOT 1
- Limit connections by a single IP address. HOT 5
- Support loading certificates from Cert-Manager HOT 1
- Post-Quantum Key Exchange support for HTTPS HOT 3
- To support HTTP Basic authentication for docker/swarm provider's endpoint HOT 1
- Environment Variables HOT 3
- Basic Auth Automatically encode Base64 - basicauth.users HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from traefik.