<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9" -->

---
title: Using Application Metrics to fix a broken size estimator
description: A developer building Cliparr, a browser-based video clipping tool, describes how Sentry&#x27;s Application Metrics revealed that an AI-generated video size...
canonical: https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Using Application Metrics to fix a broken size estimator | daily.dev
og:description: A developer building Cliparr, a browser-based video clipping tool, describes how Sentry&#x27;s Application Metrics revealed that an AI-generated video size...
og:url: https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9
og:image: https://api.daily.dev/og/posts/QHWYeDPs9.png
og:image:alt: Using Application Metrics to fix a broken size estimator
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Application Metrics to fix a broken size estimator

**[Sentry Engineering](https://daily.dev/sources/sentry)** · 18 min read · 0 upvotes · 0 comments

## Summary

A developer building Cliparr, a browser-based video clipping tool, describes how Sentry's Application Metrics revealed that an AI-generated video size estimator was up to 83% inaccurate. Rather than using logs or sampled traces, the author instrumented distributions and counters to track estimate accuracy, usage patterns, conversion success, and PWA install funnels. Grouping the resulting data by attributes exposed the broken estimator (which mistakenly factored in resolution instead of bitrate), a copy-mode over-estimate, and a GIF estimator bias, all of which were fixed after replacing the formula with a simple bitrate x duration calculation, bringing accuracy within ~5%.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.sentry.io/metrics-caught-ai-size-estimate>

## Questions this post answers

### Should I use metrics, logs, or traces to track a KPI like size estimate accuracy in my app?

Use metrics rather than logs or traces for KPIs where every measurement matters, such as a ratio computed on every conversion. Traces are commonly sampled, so they miss events needed for accurate totals, and logs are meant for debugging state rather than being a deliberate measurement. Counters, gauges, and distributions in Sentry are purpose-built for counts, rates, and spreads like p50/p90.

_daily.dev surfaces practical observability patterns for developers deciding between metrics, logs, and traces._

### Why would a bitrate-based video size formula (bitrate x duration) fail after an AI coding assistant modified it to also factor in resolution?

Because encoder bitrate is set independently of resolution, resolution does not belong in a file size calculation; only bitrate and duration determine output size for a given codec. An AI assistant's estimator that scaled size by (targetHeight / sourceHeight) produced outputs up to 83% larger than predicted, since resolution affects quality, not the number of bits written per second.

_Developers debugging AI-generated code with subtle logic errors can track down issues like this via daily.dev._

### How accurate is a variable bitrate (VBR) encoder's output size compared to a simple bitrate times duration estimate?

With a corrected bitrate-based formula, real-world video conversions landed within about 5% of the estimated size (average ratio 0.97, range 0.84-1.05) despite using a variable bitrate encoder. A broken AI-written formula that factored in resolution instead had produced outputs up to 83% larger than estimated (average ratio 1.57, range 1.30-1.83).

_daily.dev helps developers building media or encoding tools compare estimator approaches before shipping._

## Similar posts on daily.dev

- [Size Analysis - Monitor and reduce your mobile app size](https://daily.dev/posts/size-analysis---monitor-and-reduce-your-mobile-app-size-drmwl0qqy) · Emerge Tools · 0 upvotes · 0 comments
- [Catching Apple Update Breakage Before Users Do](https://daily.dev/posts/catching-apple-update-breakage-before-users-do-ukeseh590) · Sentry Engineering · 0 upvotes · 0 comments

---

Tags: [#observability](https://daily.dev/tags/observability), [#vibe-coding](https://daily.dev/tags/vibe-coding)

[View this post on daily.dev](https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Using Application Metrics to fix a broken size estimator","url":"https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9"},"datePublished":"2026-09-01T15:26:34.608Z","dateModified":"2026-09-01T15:26:59.815Z","description":"A developer building Cliparr, a browser-based video clipping tool, describes how Sentry's Application Metrics revealed that an AI-generated video size...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/41a8373bd144f9e37ea18ac6064a6fa1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/41a8373bd144f9e37ea18ac6064a6fa1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Sentry Engineering","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Sentry Engineering","logo":"https://media.daily.dev/image/upload/s--qqXwMThM--/f_auto/v1710505439/logos/sentry","url":"https://daily.dev/sources/sentry"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"observability,vibe-coding","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sentry Engineering","item":"https://daily.dev/sources/sentry"},{"@type":"ListItem","position":3,"name":"Using Application Metrics to fix a broken size estimator"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/using-application-metrics-to-fix-a-broken-size-estimator-qhwyedps9#faq","mainEntity":[{"@type":"Question","name":"Should I use metrics, logs, or traces to track a KPI like size estimate accuracy in my app?","acceptedAnswer":{"@type":"Answer","text":"Use metrics rather than logs or traces for KPIs where every measurement matters, such as a ratio computed on every conversion. Traces are commonly sampled, so they miss events needed for accurate totals, and logs are meant for debugging state rather than being a deliberate measurement. Counters, gauges, and distributions in Sentry are purpose-built for counts, rates, and spreads like p50/p90. daily.dev surfaces practical observability patterns for developers deciding between metrics, logs, and traces."}},{"@type":"Question","name":"Why would a bitrate-based video size formula (bitrate x duration) fail after an AI coding assistant modified it to also factor in resolution?","acceptedAnswer":{"@type":"Answer","text":"Because encoder bitrate is set independently of resolution, resolution does not belong in a file size calculation; only bitrate and duration determine output size for a given codec. An AI assistant's estimator that scaled size by (targetHeight / sourceHeight) produced outputs up to 83% larger than predicted, since resolution affects quality, not the number of bits written per second. Developers debugging AI-generated code with subtle logic errors can track down issues like this via daily.dev."}},{"@type":"Question","name":"How accurate is a variable bitrate (VBR) encoder's output size compared to a simple bitrate times duration estimate?","acceptedAnswer":{"@type":"Answer","text":"With a corrected bitrate-based formula, real-world video conversions landed within about 5% of the estimated size (average ratio 0.97, range 0.84-1.05) despite using a variable bitrate encoder. A broken AI-written formula that factored in resolution instead had produced outputs up to 83% larger than estimated (average ratio 1.57, range 1.30-1.83). daily.dev helps developers building media or encoding tools compare estimator approaches before shipping."}}]}
```

