-
Notifications
You must be signed in to change notification settings - Fork 237
Align metering with namespace quotas #2007
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
base: develop
Are you sure you want to change the base?
Align metering with namespace quotas #2007
Conversation
| val tags = Map( | ||
| "metric_ws" -> ws, | ||
| "metric_ns" -> ns, | ||
| "dataset" -> dsRef.dataset, |
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.
when dsRef.dataset is null. Can you use "unknown" or "null" as the value.
|
|
||
| // Update query bytes scanned per minute based on active timeseries and configured max data per shard | ||
| val maxDataPerShardQuery = settings.config.getBytes("max-data-per-shard-query").longValue() | ||
| val avgBytesPerTs = maxDataPerShardQuery / 1000000 // Convert to MB for better readability |
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.
not sure about this. The name is bytes but the value is MB?
alextheimer
left a comment
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.
Left some comments; will discuss more offline, as well
| private val METRIC_LONGTERM = "tsdb_metering_longterm_timeseries" | ||
| // Quota-aligned metrics | ||
| private val METRIC_SAMPLES_INGESTED = "tsdb_metering_samples_ingested_per_min" | ||
| private val METRIC_QUERY_BYTES_SCANNED = "tsdb_metering_query_samples_scanned_per_min" |
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 this constant be named SAMPLES_SCANNED?
| // Quota-aligned metrics | ||
| private val METRIC_SAMPLES_INGESTED = "tsdb_metering_samples_ingested_per_min" | ||
| private val METRIC_QUERY_BYTES_SCANNED = "tsdb_metering_query_samples_scanned_per_min" | ||
| private val METRIC_RETAINED_TIMESERIES = "tsdb_metering_retained_timeseries" |
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 does "retained" mean?
| // Update retained timeseries count - directly maps to active timeseries | ||
| Kamon.gauge(METRIC_RETAINED_TIMESERIES) | ||
| .withTags(TagSet.from(tags)) | ||
| .update(data.counts.active.toDouble) |
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.
Isn't this the same thing as METRIC_ACTIVE? Why are both needed?
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 think these names are from the design doc. Need Alex Goodwin to confirm.
Current behavior : (link exiting issues here : https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests)
New behavior :
This PR enhances monitoring by adding quota-aligned metrics to track ingestion, query usage, and retained data:
New Metrics
tsdb_metering_samples_ingested_per_min: Estimated samples/min ingested (based on active timeseries +ingest-resolution-millis).tsdb_metering_query_samples_scanned_per_min: Estimated bytes/min scanned during queries (using active timeseries +max-data-per-shard-query).tsdb_metering_retained_timeseries: Active timeseries count (mirrors retained data).Configuration
Added
ingest-resolution-millisandmax-data-per-shard-queryto compute metrics.Improvements
_ws_and_ns_tags for better filtering.