Monotonically increasing totals for events and tallies.
Counters represent totals that only ever go up (reset on server restart). Use them for events that accumulate: joins, kills, items crafted, Robux spent.
local Telemetry = Zyntex:Telemetry(10)local kills = Telemetry:Counter("enemy_kills_total", { description = "Total enemy kills by weapon", labels = {"weapon"} -- optional, use to slice})-- +1 without labelskills:inc()-- +5 with a weapon labelkills:inc(5, {weapon = "Sword"})
Counters expect deltas. If you poll a current snapshot and want to convert it into a counter:
Copy
local shotsCtr = Telemetry:Counter("weapon_shots_total", { labels = {"weapon"} })local last = 0local function pushShots(current) local delta = current - last if delta > 0 then shotsCtr:inc(delta, {weapon = "Bow"}) last = current endend
Each :inc(...) updates the local running total and pushes it. Feed deltas into :inc to reflect true growth.