discord/instruments
67.2
Adequate · 3 October 2026
2.2k
lines of production code
Elixir
primary language
2
measurements over time
What this system is
This system is an Elixir library for high-performance metrics collection and system monitoring. It provides optimized components for tracking counters, gauges, and reporting rates, while also exposing detailed Erlang VM health data through configurable system monitor event reporting. The library supports flexible metric instrumentation via probes and integrates with Statsd for external metric transmission.
Features
Add system monitor event reporting with configurable receivers
The \lib/sysmon\ library introduces a new system monitoring capability that subscribes to Erlang VM system monitor events (such as long garbage collection, long schedules, large heaps, and busy ports) and forwards them to configurable handlers. The Reporter acts as a relay for these events, while the Emitter dispatches them to a Receiver module. Users can choose between a logging receiver (\Instruments.Sysmon.Receiver.Log\) for debugging or a metrics receiver (\Instruments.Sysmon.Receiver.Metrics\) that increments specific \erlang.sysmon.\*\ counters via the Instruments library. This feature is opt-in and controlled by the \:sysmon\_events\ application environment setting.
lib/sysmon · high confidence
Introduces FastGauge and RateTracker for optimized metric reporting
The library now includes a new \FastGauge\ module that uses one ETS table per scheduler to record gauge values, replacing the previous direct reporter module for gauge metrics. Additionally, a \RateTracker\ has been added to monitor the frequency of metric reporting for non-fast implementations, helping users identify metrics that are being reported too frequently and potentially causing performance issues. The \FastCounter\ module has also been updated to include randomized jitter in its reporting interval to prevent thundering herd problems.
lib · high confidence
New allocator probe and scheduler override capability
Added a new \Instruments.Probes.Allocators\ module that reports per-allocator memory statistics (including backing carrier counts and sizes) derived from \:recon\_alloc\. Updated \Instruments.Probes.Schedulers\ to support an optional \num\_logical\_processors\_override\ application configuration, allowing users to override the detected logical processor count for more accurate weighted utilization metrics in containerized environments. Also corrected a callback name mismatch in the schedulers probe (\probe\_handle\_msg\ to \probe\_handle\_message\) to align with the probe behavior.
lib/probes · high confidence
Behavioural changes
Add event sending capability and improve timing accuracy
The StatsReporter now supports sending events via a new send\_event function, allowing users to log custom events with a title and text. Additionally, the measure function has been updated to use :timer.tc for more accurate and efficient timing of passed-in functions, replacing the previous manual execution approach.
_lib/stats\reporter · high confidence
Added benchmark suites for FastCounter, FastGauge, and RateTracker
This change introduces a new \bench/\ directory containing Benchee benchmark scripts and their resulting performance data. The suite includes \increment.exs\ and \tag\_handling.exs\ to evaluate \Instruments.FastCounter\ performance across various tag counts and keyword manipulation strategies, \gauge.exs\ to compare \Instruments.FastGauge\ against \Instruments.Statix\ in single and parallel contexts, and \track.exs\ to benchmark \Instruments.RateTracker\. The included result files document the performance characteristics of these metrics, highlighting optimizations such as special-casing for empty tags and efficient keyword handling.
bench · high confidence
Expanded instrumentation capabilities and modernized supervision tree
The application now includes new metrics tools, specifically FastGauge for gauges and RateTracker for detecting frequently reported metrics, alongside the existing FastCounter. The supervision tree has been updated to use modern Elixir 1.5+ child specifications instead of the deprecated worker macro. Additionally, the system now supports optional system monitoring via a Sysmon supervisor, which is conditionally added to the supervision tree based on the :enable\_sysmon configuration flag.
lib/instruments · high confidence
Migrate to Elixir 1.10+ config syntax and add test-specific instrumentation settings
The configuration files have been updated to use the modern \import Config\ syntax instead of the deprecated \Mix.Config\, and the main config now uses \config\_env()\ for environment-specific imports. In the test configuration, new settings have been added to define report intervals and jitter ranges for fast counters, fast gauges, and rate trackers, while the logger configuration has been updated to use \compile\_time\_purge\_matching\ for purging log levels. Additionally, the system monitor is explicitly disabled in the test environment to prevent it from starting automatically during tests.
config · high confidence
Probe definitions now support unique tags and the supervisor uses a dynamic strategy
Probes can now be defined with the same name if they have different tags, as the system appends a sorted tag string to the internal probe name to ensure uniqueness. Additionally, the probe supervisor has been migrated from a standard Supervisor to a DynamicSupervisor, changing the supervision strategy to :one\_for\_one and updating child specification handling to work with the dynamic supervisor API.
lib/probe · high confidence
Test coverage
Added tests for RateTracker and improved test helper reliability; Added tests for probe tag handling and test infrastructure updates; Added tests for the Sysmon Emitter and Reporter components; Updated test support for Statsd parsing and UDP socket configuration.
Dependencies
Major dependency upgrades and project metadata updates
The project has upgraded its core dependencies to newer versions: \recon\ to 2.5.2, \statix\ to 1.8.0 (sourced from the \discord\_statix\ Hex package), and \ex\_doc\ to 0.34 (with the lockfile showing 0.40.3). New development dependencies \benchee\ (1.4) and \dialyxir\ (1.4) have been added. The minimum supported Elixir version has been raised to 1.15, and the package metadata (description, maintainers, licenses, source URL) has been explicitly defined for Hex publishing.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 66 → 67 (+0.9)
- Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.0)
- Architecture 99 → 100 (+0.2)
- Maturity 53 → 53 (+0.1)
- Readiness 58 → 61 (+3.0)
- Security 99 → 99 (+0.3)
Resolved (4)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (12 lines × 3) (lib/fast_counter.ex)
- Off-boarding risk: anonymized user #1
New (2)
- Duplicated block (13 lines × 3) (lib/fast_counter.ex)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
discord/instruments was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 246ebd9c7923c956614f9266c55da70001e90979 — the exact code this score is about.
- Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-24c657e50118.