Add OpenTelemetry Instrumenter with PII Filtering and Argument Tracking - #1
Merged
Merged
Conversation
… method instrumentation - Introduce Observable::Instrumenter class with configuration support - Automatically capture method name, namespace, arguments, and return values - Support PII filtering and configurable serialization depth - Create OpenTelemetry spans with error recording - Add example usage demonstrating instrumentation - Add comprehensive tests for instrumenter functionality - Add persistence support classes for spans and traces - Update gemspec with dependencies and metadata - Add test helpers for OpenTelemetry span inspection - Add example.rb demonstrating usage of the instrumenter This feature enables automatic instrumentation of Ruby methods with OpenTelemetry, providing detailed tracing information including method arguments and return values, with privacy filtering and error tracking. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
johngallagher
marked this pull request as ready for review
September 6, 2025 22:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Observable::Instrumenterclass for automated OpenTelemetry instrumentation of Ruby methodsChanges
Core Functionality
lib/observable/instrumenter.rbimplementing the Instrumenter with:lib/observable.rbto expose a convenience method for creating an instrumenter instanceConfiguration
Observable::Configurationusingdry-configurablefor:Example and Tests
example.rbdemonstrating configuration and usage of the instrumentertest/instrumenter_test.rbwith tests covering:Test Support
test/support/persistencetest/support/tracing_test_helper.rbfor OpenTelemetry test setup and span accesstest/test_helper.rbto configure OpenTelemetry SDK for testsMiscellaneous
observable.gemspecto:opentelemetry-sdk,dry-configurable, anddry-structTest plan
test/instrumenter_test.rbpass successfullyThis PR lays the foundation for robust OpenTelemetry instrumentation in Ruby applications with flexible configuration and strong test coverage.
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/ab86460c-5aff-431c-a974-508e612c6b26