frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: LogCost – map logging cost to specific log lines

https://github.com/ubermorgenland/LogCost
1•random_round•44m ago
We kept running into the same pattern with logging costs:

  - CloudWatch / GCP Logging / Datadog tell you which log group/index is expensive
  - But not which specific log statements in your code are responsible

  So the response is always:

  - tweak retention / tiers
  - add filters and sampling

  …and only much later do you discover it was a couple of DEBUG lines in a hot path, verbose HTTP tracing, or payload dumps in loops.

  At some point we wanted a simple answer to:

  > “For the code that’s deployed right now, which log call sites are burning most of the budget?”

  ———

  ### What LogCost does

  LogCost is a small Python library + CLI that:

  - wraps the standard logging module (and optionally print)
  - tracks per‑call‑site metrics:
    {file, line, level, message_template, count, total_bytes}
  - applies provider pricing (e.g. GCP/AWS) to estimate cost
  - periodically exports aggregated stats only (no raw log payloads)
  - can send Slack notifications with the top N most expensive log lines

  It’s intended as a snapshot for the current deploy: run it under normal load, see which lines dominate cost, change them, redeploy, repeat.

  ———

  ### How it works (high level)

  - It wraps logging.Logger._log and records a key per call site using file, line, and level.
  - Message size is estimated from the formatted string length plus a configurable per‑event overhead, and accumulated per call site.
  - A background thread periodically flushes aggregates to JSON on disk.
  - The CLI reads that JSON and prints:
      - a cost summary (based on current provider pricing), and
      - a “top cost drivers” table per call site.

  By design it never stores raw log payloads, only aggregates like:

  {
    "file": "src/memory_utils.py",
    "line": 338,
    "level": "DEBUG",
    "message_template": "Processing step: %s",
    "count": 1200000,
    "bytes": 630000000,
    "estimated_cost": 315.0
  }

  That’s partly for privacy, and partly because this is meant to complement your log platform, not replace it.

  ———

  ### Example output

  A report might say:

  - Provider: GCP, Currency: USD
  - Total bytes: 900,000,000,000
  - Estimated cost: 450.00

  Top cost drivers:

  - src/memory_utils.py:338 [DEBUG] Processing step: %s → $157.50
  - src/api.py:92 [INFO] Request: %s → $73.20
  - …

  Slack notifications are just a formatted version of the same data, on a configurable interval (with an optional early “test” ping so you can verify wiring).

  ———

  ### Scope and status

  - Python‑only for now (Flask/FastAPI/Django / K8s sidecar examples)
  - MIT‑licensed, no backend service required
  - Export format is simple JSON, so it could feed a central aggregator later if needed

  Repo:
  https://github.com/ubermorgenland/LogCost

  I’d be interested in feedback from people who’ve debugged “mysterious” log bills:

  - Do you already solve this mapping (bill → specific log sites) in a cleaner way?
  - Is per‑line aggregation actually useful in your setups, or is this overkill compared to just better log group conventions?

Show HN: Vect AI– The "Resonance Engine" for high-growth marketing

https://vect.pro/
1•asaws•46s ago•0 comments

The "Inhuman Centipede" and Identity

https://syntheticauth.ai/posts/synthetic-auth-report-issue-020#carbon-based-paradox
1•zerolayers•1m ago•1 comments

Saving Skylab

https://www.airandspace.si.edu/stories/editorial/saving-skylab
1•fanf2•2m ago•0 comments

AI-Assisted Coding Killed My Joy of Programming

https://meysam.io/blog/ai-assisted-coding-killed-programming-joy/
1•meysamazad•2m ago•0 comments

Learn with Ari

https://arihara-sudhan.github.io/learn-with-ari/
1•arihara-sudhan•6m ago•0 comments

What is scalability anyway? (2024)

https://brooker.co.za/blog/2024/01/18/scalability.html
1•linhns•11m ago•0 comments

Digital Omnibus: Analysis of GDPR and EPrivacy Proposals by the Commission

https://noyb.eu/en/digital-omnibus-first-analysis-select-gdpr-and-eprivacy-proposals-commission
2•buzer•11m ago•0 comments

The Oceans Are Going to Rise–But When?

https://www.wired.com/story/the-oceans-are-going-to-rise-but-when/
3•Brajeshwar•12m ago•0 comments

Web dev's crawler took down major online bookstore by buying too many books

https://www.theregister.com/2025/12/01/who_me/
1•Brajeshwar•12m ago•0 comments

Zipcar proposes to cease its UK operations

https://support.zipcar.co.uk/hc/en-gb/articles/46980698921875-Zipcar-proposes-to-cease-its-UK-ope...
4•seasicksteve•12m ago•0 comments

College Students Choosing A.I. Majors over Computer Science

https://www.nytimes.com/2025/12/01/technology/college-computer-science-ai-boom.html
1•fleahunter•14m ago•0 comments

Plato's Republic as an iMessage Thread

https://pmohun.github.io/therepublic-txt/
1•pmohun•15m ago•1 comments

Google *Unkills* JPEG XL?

https://tonisagrista.com/blog/2025/google-unkills-jpegxl/
2•speckx•15m ago•0 comments

Show HN: Walrus – a Kafka alternative written in Rust

https://github.com/nubskr/walrus
2•janicerk•16m ago•0 comments

Evo-Memory: Benchmarking LLM Agent Test-Time Learning with Self-Evolving Memory

https://arxiv.org/abs/2511.20857
1•simonpure•17m ago•0 comments

Impacts of Cyclonic Storm Senyar viewed through Sentinel satellite imagery data

https://rtnf.substack.com/p/impacts-of-cyclonic-storm-senyar
2•altilunium•18m ago•0 comments

OpenAI Ads Are Coming

https://twitter.com/btibor91/status/1994714152636690834
2•deeptishukla22•19m ago•2 comments

Agentive SEO

https://agentiveseo.com/
1•bellamoon544•19m ago•3 comments

Alternatives to Police – Do They Work?

https://www.nominalnews.com/p/alternatives-to-police-do-they-work
2•MPLan•19m ago•1 comments

Upbit was hacked $37M Solana. How could we have hacked and protected it?

https://substack.bomfather.dev/p/upbit-hacked-37m-solana-how-would
4•nathannaveen•20m ago•0 comments

What's new at Stack Overflow: December 2025

https://stackoverflow.blog/2025/12/01/what-s-new-at-stack-overflow-december-2025/
2•quapster•21m ago•0 comments

ATP signal in the hippocampus may be a key driver of depression and anxiety

https://www.sciencedaily.com/releases/2025/11/251126025315.htm
1•mmaia•22m ago•0 comments

The World Still Hasn't Made Sense of ChatGPT

https://www.theatlantic.com/technology/2025/11/chatgpt-third-anniversary/685084/
2•voxleone•22m ago•0 comments

Prompt Injection Through Poetry

https://www.schneier.com/blog/archives/2025/11/prompt-injection-through-poetry.html
1•speckx•23m ago•1 comments

Washington Must Break Its Promise on Social Security

https://www.bloomberg.com/opinion/articles/2025-12-01/congress-must-save-social-security-from-ins...
1•toomuchtodo•25m ago•1 comments

Metaverse Solutions

https://www.accenture.com/us-en/services/metaverse
2•Klaster_1•25m ago•0 comments

Google, Nvidia, and OpenAI – Stratechery by Ben Thompson

https://stratechery.com/2025/google-nvidia-and-openai/
3•tambourine_man•25m ago•0 comments

I Went All-In on AI. The MIT Study Is Right

https://leadershiplighthouse.substack.com/p/i-went-all-in-on-ai-the-mit-study
2•gmays•26m ago•0 comments

Hasktorch: LibTorch Haskell bindings for deep learning using FFI

https://www.stackbuilders.com/insights/hasktorch-libtorch-haskell-bindings-for-deep-learning-usin...
2•StackBuilders•26m ago•0 comments

Formal Proof: LLM Hallucinations Are Structural, Not Statistical (Coq Verified)

https://philpapers.org/rec/SCHTIC-17
2•ICBTheory•28m ago•2 comments