Skip to content

feat(metrics): add vods size in bytes metrics#1096

Merged
Zibbp merged 1 commit intoZibbp:mainfrom
Entrivax:totalSizeMetrics
Mar 5, 2026
Merged

feat(metrics): add vods size in bytes metrics#1096
Zibbp merged 1 commit intoZibbp:mainfrom
Entrivax:totalSizeMetrics

Conversation

@Entrivax
Copy link
Contributor

@Entrivax Entrivax commented Mar 5, 2026

#1095 (comment) I'm a little bit late, it was merged just before I finished to add the bytes part

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2227e3c2-197b-4e7e-8d77-8672d8bb8421

📥 Commits

Reviewing files that changed from the base of the PR and between a564d6c and ac6248c.

📒 Files selected for processing (1)
  • internal/metrics/metrics.go

Walkthrough

The pull request adds two new Prometheus metrics to track VOD storage sizes: a Gauge for total VODs bytes and a GaugeVec for per-channel VOD bytes. These metrics are initialized in NewService and populated in GatherMetrics by aggregating vod.StorageSizeBytes values.

Changes

Cohort / File(s) Summary
Prometheus Metrics Enhancement
internal/metrics/metrics.go
Adds totalVodsBytes Gauge and channelVodBytes GaugeVec fields to the Metrics struct. Initializes and registers these metrics in NewService. Extends GatherMetrics to compute per-channel VOD storage sizes by aggregating vod.StorageSizeBytes and updates the channel-level aggregation loop to track both duration and storage bytes.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding VOD size metrics in bytes to the metrics system.
Description check ✅ Passed The description is related to the changeset, explaining the context that this PR adds the bytes portion of VOD size metrics.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Owner

@Zibbp Zibbp left a comment

Choose a reason for hiding this comment

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

sorry for merging the other one too soon, thanks!

@Zibbp Zibbp merged commit a2d6409 into Zibbp:main Mar 5, 2026
8 checks passed
@Entrivax
Copy link
Contributor Author

Entrivax commented Mar 5, 2026

No problem!

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.

2 participants