Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-stats: Track metrics name collisions
Problem Metrics recorded in a scope Seq("foo", "bar") can collide with Seq("foo/bar") when exporting the metrics to JSON, where one is arbitrarily picked. This hides metrics bugs in application code. Solution Add a default-off flag to throw an exception when colliding stats are created in the common cases, and a lint rule that catches most cases (histogram names can be tricky). Result Bugs in application metrics are much easier to find for users. Note: I assumed performance is important in the metrics implementation, so I avoided using an extra map to detect duplicate names in favor of using the existing map. All of this could be simplified if we used a second map, or if the canonical names were the formatted strings. JIRA Issues: CSL-6578 Differential Revision: https://phabricator.twitter.biz/D183494
- Loading branch information