Skip to content

finance: pin real per-GiB rate for infra.event.bytes (seeded at 1 µ$/GiB floor) #26

Description

@I-am-nothing

Context

Migration 020_p1_infra_catalog_seed (PR #4 of the infra-metrics roadmap) seeds the P1 producer-target infra metrics. One of them, infra.event.bytes, has no defensible documented per-unit cost yet.

The design doc (docs-temp/infra-metrics/design.md §2.2) carries a 1 (internal bus, finance pins) placeholder. Taken literally as 1 µ\$/byte that is ~$1.07e9/GiB; even $1/MB is ~$1.05e6/GiB — both implausible for a real messaging bus.

What was seeded

To avoid two failure modes — (a) silent floor-to-0 under the BIGINT integer unit price (rule 5), and (b) massively OVERCHARGING if an inflated placeholder is forgotten — infra.event.bytes is seeded conservatively at:

  • kind: sum
  • unit: GiB (per design §3 rule 5; producer emits value = bytes / 1024^3)
  • unit_price_micros: 1 µ$/GiB (intentionally LOW floor; ≥1 so no silent-zero)

This currently UNDER-bills event bytes by ~6 orders of magnitude vs real cost.

What finance must do

Pin the real per-GiB rate before the infra.event.bytes producer goes live (PR #6, async). AWS EventBridge data-volume order of magnitude is ~$1/GB ≈ 1,000,000 µ\$/GiB; SNS ~$0.50/GB. Update the seeded row (or set the DB row directly — ON CONFLICT DO NOTHING means a finance edit survives re-init).

References

  • migrations/billing/020_p1_infra_catalog_seed.up.sql (the infra.event.bytes row + TODO(finance))
  • docs-temp/infra-metrics/design.md §2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions