-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
chore(aggregated_metrics): Add metrics to aggreated metrics #14986
Conversation
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.
thanks for adding this! just a few small things
pkg/pattern/aggregation/push.go
Outdated
@@ -142,6 +147,7 @@ func NewPush( | |||
entries: entries{ | |||
entries: make([]entry, 0), | |||
}, | |||
metrics: NewMetrics(registrer, "pattern_ingester"), |
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.
should the namespace be loki
here? we already have the subsystem as pattern_ingester
, so I think this would make the metric have pattern_ingester
in it twice?
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.
yes, missed this one. Fixed.
pkg/pattern/aggregation/push.go
Outdated
p.metrics.streamsPerPush.WithLabelValues(p.tenantID).Observe(float64(len(streams))) | ||
p.metrics.entriesPerPush.WithLabelValues(p.tenantID).Observe(float64(len(entries))) | ||
p.metrics.servicesTracked.WithLabelValues(p.tenantID).Set(float64(len(entriesByStream))) |
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.
what's the difference between number of streams and the length of the entries by stream map? won't those always be the same?
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.
Fixed, was supposed to count services tracked.
pkg/pattern/aggregation/push.go
Outdated
@@ -287,6 +297,31 @@ func (p *Push) run(pushPeriod time.Duration) { | |||
} | |||
} | |||
|
|||
func (p *Push) sendPayload(ctx context.Context, payload []byte) (int, error) { |
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 couldn't find any references to this new function, is it being used?
pkg/pattern/aggregation/push.go
Outdated
if err != nil { | ||
errorType := "unknown" | ||
if status == 429 { | ||
errorType = "rate_limited" |
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.
could we move these to constants so their easier to find, and test against?
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.
Yep, moved this to constants
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.
lgtm, thanks Shantanu!
What this PR does / why we need it:
Adds metrics to aggregated metrics to better quantify the subsystem and also create a dashboard.
Which issue(s) this PR fixes:
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR