Skip to content

Conversation

@bdeitte
Copy link
Owner

@bdeitte bdeitte commented Jan 24, 2026

Fix for #238 and update docs after understanding better #264

Copilot AI review requested due to automatic review settings January 24, 2026 01:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #238 by adding sanitization of protocol-breaking characters in metric names and tags, and updates documentation to reflect OpenTelemetry Collector compatibility (issue #264).

Changes:

  • Adds sanitization logic to prevent protocol-breaking characters (:, |, \n, #, ,) in metric names and tags from creating malformed StatsD packets
  • Introduces separate sanitization functions for metric names, tag keys, and tag values with appropriate character restrictions for each
  • Updates documentation to highlight OpenTelemetry Collector compatibility and reorder backend references

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/helpers.js Adds sanitizeMetricName and sanitizeTagValue functions, updates sanitizeTags to handle newlines and hash characters, modifies formatTags to sanitize tag keys and values separately
lib/statsd.js Applies metric name sanitization before constructing StatsD messages
test/helpers.js Adds comprehensive test coverage for the new sanitization functions and updates existing tests to reflect sanitization behavior
test/statsFunctions.js Adds integration tests verifying sanitization works correctly across different metric types and scenarios
test/childClient.js Updates test assertion to expect sanitized tag format
README.md Updates documentation to list OpenTelemetry as a supported backend and adds compatibility matrix
CHANGES.md Documents the bug fix and documentation updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bdeitte bdeitte merged commit 5ed593c into main Jan 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants