Skip to content

Metrics tweaks#34

Merged
colmsnowplow merged 3 commits intofeat/buffered-data-metricfrom
metrics-tweaks
Sep 10, 2025
Merged

Metrics tweaks#34
colmsnowplow merged 3 commits intofeat/buffered-data-metricfrom
metrics-tweaks

Conversation

@colmsnowplow
Copy link

This PR:

  • Buffers metrics every second
  • Adds tests for statsreceiver
  • Adds a config to control what metrics we want

Josh (@jbeemster) as an FYI - not essential to get your review on it

Copy link

@oo-sleeper Mikhail (oo-sleeper) left a comment

Choose a reason for hiding this comment

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

LGTM 🎸

@colmsnowplow colmsnowplow merged commit 8fc3478 into feat/buffered-data-metric Sep 10, 2025
1 check passed
@colmsnowplow colmsnowplow deleted the metrics-tweaks branch September 10, 2025 10:05
// this provides natural fairness over time while controlling peak memory usage.
// Example: Setting to 20 limits memory to ~20 * 10k records * avg_record_size
maxConcurrentShards int
metricsConfig MetricsConfig

Choose a reason for hiding this comment

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

Looks like it's here and it's in each stats receiver implementation. How is this field used here in top-level config?

Copy link
Author

Choose a reason for hiding this comment

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

It's not, it's just passed down - I just felt that it should be a configuration of the app rather than buried in the stats receiver. Perhaps that's not the right pattern though

Choose a reason for hiding this comment

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

I can't see how it's passed down, if we remove this field from here, everything still works, right?

I think if we have this field here, we should do enable/disable check layer above, sth like:

if k.config.metricsConfig == nil || k.config.metricsConfig.EnableEventToClient {
	k.config.stats.EventToClient(*record.record.ApproximateArrivalTimestamp, record.retrievedAt)
} 

in kinsumer.go, not in statsd implemenation.

Copy link
Author

Choose a reason for hiding this comment

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

Oooh I see what you mean, apologies! Yeah I agree. And actually, I dislike both 😂

Prepping a follow-up PR to hopefully do something cleaner thanks for flagging!

Copy link
Author

Choose a reason for hiding this comment

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

#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants