-
Notifications
You must be signed in to change notification settings - Fork 71
Instrument cortex tenant #35
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
Conversation
processor.go
Outdated
|
|
||
| var r result | ||
| r.code, r.body, r.err = p.send(clientIP, reqID, tenant, wrReq) | ||
| r.code, r.body, r.duration, r.err = p.send(clientIP, reqID, tenant, wrReq) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should switch to just return result struct here? too many fields returned already :)
processor.go
Outdated
| return | ||
| } | ||
|
|
||
| duration = float64(time.Since(start).Milliseconds()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess since we anyway are using float64 then it's better to store seconds there, not milliseconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was made milliseconds because it's more likely for this value to be pretty small... I ripped this metric and buckets from the tool Istio
|
Thanks! I've left a few small comments and have a bigger one - maybe we should also add |
| }() | ||
| } | ||
|
|
||
| go func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already cfg.ListenPprof -> maybe we can use that instead of another hardcoded HTTP port? Maybe we can rename cfg.ListenPprof to something more general, like ListenAux or whatever. Or add additional config variable ListenMetrics and use that (with same default value of :9090)
We can offer it, but may I suggest making it configurable? Some folks may have lots of tenants which would cause a lot of metric cardinality |
|
Yeah, probably makes sense, it's safer to either make it configurable or put some limit on the number of tenant metrics. |
|
@blind-oracle ready for another review |
config.go
Outdated
| Listen string `env:"CT_LISTEN"` | ||
| ListenPprof string `yaml:"listen_pprof" env:"CT_LISTEN_PPROF"` | ||
| ListenMetricsAddress string `yaml:"listen_metrics_address" env: "CT_LISTEN_METRICS_ADDRESS"` | ||
| ListenMetricsIncludeTenant bool `yaml:"listen_metrics_include_tenant" env: "CT_LISTEN_METRICS_INCLUDE_TENANT"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's maybe rename it to smth like MetricsIncludeTenantLabel since it really has nothing to do with listening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blind-oracle cool, done
|
Super, let's merge it as is, if something comes up we can improve later. Thanks! |
|
@blind-oracle would you mind "releasing" (ie publishing the image) so I can use these changes? Thanks! |
|
Done, I need to setup some workflow for that... 🤔 |
Adding RED metrics to cortex-tenant.