Skip to content

[Feature] Stock metric actor_mailbox_dropped_total labels by actor path — unbounded cardinality #658

Description

@pathosDev

Problem

ActorCell emits actor_mailbox_dropped_total with labels { class, path, reason } (src/internal/ActorCell.ts:827-834). DefaultMetricsRegistry keys children by label-tuple in a Map that is only cleared wholesale (src/metrics/Metrics.tsclear() is documented "primarily for tests"). Anonymous actors get $1, $2, … (src/internal/ActorCell.ts:187-197).

A per-request actor pattern under load — or sharded entities, whose ids are user-supplied and become actor paths — creates one permanent series per actor, in-process and in Prometheus. The metrics module's own doc warns "high-cardinality labels … will OOM your monitoring system" — and the framework's stock metric ships one. This is a concrete, framework-made instance of #131's threat model.

Proposed behaviour

Drop path from the stock label set (keep class + reason), or gate it behind an explicit opt-in high-cardinality flag.

Acceptance criteria

  • Spawning 10 000 anonymous actors that overflow produces O(1) series.

Related: #131, #196

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpriority: mediumUseful, not urgentproduction-goalBlocks or defines the path to production readiness

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions