Skip to content

Conversation

@p-datadog
Copy link
Member

What does this PR do?
Adds notifications about failed condition evaluation for line and method probes. The notifications are subject to a fixed rate limit of one per second.

Motivation:
Feature parity with other languages

Change log entry
None (expression language is not yet released to customers)

Additional Notes:

How to test the change?

Tests are added

@p-datadog p-datadog requested a review from a team as a code owner October 14, 2025 15:02
@github-actions
Copy link

github-actions bot commented Oct 14, 2025

Typing analysis

Note: Ignored files are excluded from the next sections.

steep:ignore comments

This PR introduces 3 steep:ignore comments, and clears 3 steep:ignore comments.

steep:ignore comments (+3-3)Introduced:
lib/datadog/di/instrumenter.rb:117
lib/datadog/di/instrumenter.rb:209
lib/datadog/di/instrumenter.rb:301
Cleared:
lib/datadog/di/instrumenter.rb:121
lib/datadog/di/instrumenter.rb:189
lib/datadog/di/instrumenter.rb:286

Untyped methods

This PR introduces 10 untyped methods and 9 partially typed methods, and clears 6 untyped methods and 8 partially typed methods. It decreases the percentage of typed methods from 51.26% to 51.09% (-0.17%).

Untyped methods (+10-6)Introduced:
sig/datadog/di/probe_manager.rbs:48
└── def remove_other_probes: (untyped probe_ids) -> untyped
sig/datadog/di/probe_manager.rbs:51
└── def install_pending_method_probes: (untyped cls) -> untyped
sig/datadog/di/probe_manager.rbs:54
└── def install_pending_line_probes: (untyped path) -> untyped
sig/datadog/di/probe_manager.rbs:55
└── def probe_executed_callback: (untyped context) -> untyped
sig/datadog/di/probe_manager.rbs:57
└── def probe_condition_evaluation_failed_callback: (untyped context, untyped expr, untyped exc) -> untyped
sig/datadog/di/probe_notification_builder.rbs:42
└── def tags: () -> untyped
sig/datadog/di/probe_notification_builder.rbs:44
└── def serialized_tags: () -> untyped
sig/datadog/di/proc_responder.rbs:8
└── def initialize: (untyped executed_proc, ?untyped? failed_proc) -> void
sig/datadog/di/proc_responder.rbs:14
└── def probe_executed_callback: (untyped context) -> untyped
sig/datadog/di/proc_responder.rbs:16
└── def probe_condition_evaluation_failed_callback: (untyped context, untyped exc) -> untyped
Cleared:
sig/datadog/di/probe_manager.rbs:50
└── def do_add_probe: (untyped probe) -> untyped
sig/datadog/di/probe_manager.rbs:53
└── def remove_other_probes: (untyped probe_ids) -> untyped
sig/datadog/di/probe_manager.rbs:56
└── def install_pending_method_probes: (untyped cls) -> untyped
sig/datadog/di/probe_manager.rbs:59
└── def install_pending_line_probes: (untyped path) -> untyped
sig/datadog/di/probe_notification_builder.rbs:39
└── def tags: () -> untyped
sig/datadog/di/probe_notification_builder.rbs:41
└── def serialized_tags: () -> untyped
Partially typed methods (+9-8)Introduced:
sig/datadog/di/instrumenter.rbs:36
└── def hook_method: (Probe probe, untyped responder) -> void
sig/datadog/di/instrumenter.rbs:39
└── def hook_line: (Probe probe, untyped responder) -> void
sig/datadog/di/instrumenter.rbs:43
└── def hook: (Probe probe, untyped responder) -> void
sig/datadog/di/probe_notification_builder.rbs:25
└── def build_snapshot_base: (Context context, ?evaluation_errors: Array[untyped]?, ?captures: untyped?, ?message: String?) -> Hash[Symbol,untyped]
sig/datadog/di/probe_notification_builder.rbs:27
└── def build_condition_evaluation_failed: (Context context, untyped expr, untyped exception) -> Hash[Symbol,untyped]
sig/datadog/di/probe_notification_builder.rbs:29
└── def build_status: (Probe probe, message: untyped, status: untyped) -> Hash[Symbol,untyped]
sig/datadog/di/probe_notification_builder.rbs:31
└── def format_caller_locations: (Array[untyped] callers) -> Array[Hash[Symbol,untyped]]
sig/datadog/di/probe_notification_builder.rbs:33
└── def evaluate_template: (untyped template, Context context) -> [String, Array[String]]
sig/datadog/di/probe_notification_builder.rbs:37
└── def get_local_variables: (TracePoint trace_point) -> Hash[Symbol,untyped]
Cleared:
sig/datadog/di/instrumenter.rbs:36
└── def hook_method: (Probe probe) ?{ (?) -> untyped } -> void
sig/datadog/di/instrumenter.rbs:39
└── def hook_line: (Probe probe) ?{ (?) -> untyped } -> void
sig/datadog/di/instrumenter.rbs:43
└── def hook: (Probe probe) { (?) -> untyped } -> void
sig/datadog/di/probe_manager.rbs:60
└── def probe_executed_callback: (Context context) -> untyped
sig/datadog/di/probe_notification_builder.rbs:26
└── def build_status: (Probe probe, message: untyped, status: untyped) -> Hash[Symbol,untyped]
sig/datadog/di/probe_notification_builder.rbs:28
└── def format_caller_locations: (Array[untyped] callers) -> Array[Hash[Symbol,untyped]]
sig/datadog/di/probe_notification_builder.rbs:30
└── def evaluate_template: (untyped template, Context context) -> [String, Array[String]]
sig/datadog/di/probe_notification_builder.rbs:34
└── def get_local_variables: (TracePoint trace_point) -> Hash[Symbol,untyped]

Untyped other declarations

This PR introduces 5 untyped other declarations, and clears 1 untyped other declaration. It decreases the percentage of typed other declarations from 65.75% to 65.54% (-0.21%).

Untyped other declarations (+5-1)Introduced:
sig/datadog/di/probe_manager.rbs:58
└── attr_reader definition_trace_point: untyped
sig/datadog/di/proc_responder.rbs:4
└── @executed_proc: untyped
sig/datadog/di/proc_responder.rbs:6
└── @failed_proc: untyped
sig/datadog/di/proc_responder.rbs:10
└── attr_reader executed_proc: untyped
sig/datadog/di/proc_responder.rbs:12
└── attr_reader failed_proc: untyped
Cleared:
sig/datadog/di/probe_manager.rbs:61
└── attr_reader definition_trace_point: untyped

If you believe a method or an attribute is rightfully untyped or partially typed, you can add # untyped:accept to the end of the line to remove it from the stats.

@datadog-official
Copy link

datadog-official bot commented Oct 14, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage
Patch Coverage: 92.04%
Total Coverage: 98.55% (-0.02%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cd8f2c0 | Docs | Was this helpful? Give us feedback!

@p-datadog p-datadog added this to the 2.22.0 milestone Oct 14, 2025
@Strech Strech removed this from the 2.22.0 milestone Oct 15, 2025
@p-datadog p-datadog force-pushed the di-eval-failed-rate-limit branch from 4c56456 to cd8f2c0 Compare October 23, 2025 20:38
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.

3 participants