Skip to content

Update span to 1.1.5 and warn on FORMERR responses#38

Merged
loks0n merged 1 commit intomainfrom
feat-formerr-span-warn
Feb 17, 2026
Merged

Update span to 1.1.5 and warn on FORMERR responses#38
loks0n merged 1 commit intomainfrom
feat-formerr-span-warn

Conversation

@loks0n
Copy link
Contributor

@loks0n loks0n commented Feb 17, 2026

Summary

  • Update utopia-php/span from 1.1.4 to 1.1.5
  • Set span level to warn on FORMERR responses (partial decoding errors and missing question section) to distinguish them from error (exceptions) and info (successful responses)

Test plan

  • Verify FORMERR responses from malformed packets produce spans with level warn
  • Verify other error responses (SERVFAIL) still produce spans with level error
  • Verify successful responses still produce spans with level info

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Enhanced telemetry tracking for DNS server error conditions to better diagnose and monitor query-related issues.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 17, 2026

Walkthrough

This pull request adds telemetry instrumentation to two error handling paths in the DNS Server. Specifically, the telemetry span level is set to "warn" in two scenarios: when a PartialDecodingException occurs and when a DNS query contains no questions. Both modifications precede the generation of FORMERR (format error) responses. No changes to control flow, logic, or public API are introduced.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: updating the span dependency and adding warn-level logging for FORMERR responses, which aligns with the file modifications shown in the summary.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-formerr-span-warn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/DNS/Server.php (1)

200-207: Consider setting a span level for the NOTIMP response path.

The FORMERR paths now set level to warn, but the NOTIMP path (unsupported opcode) returns early without any span level annotation. For consistency, you may want to add a similar $span->set('level', 'warn') here as well.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/DNS/Server.php` around lines 200 - 207, The NOTIMP (unsupported opcode)
return path in the opcode check currently returns early without setting span
level; add a span annotation similar to the FORMERR paths by calling
$span->set('level', 'warn') just before creating/returning the NOTIMP response
in the block that checks $query->header->opcode !== 0 (around the
Message::response(...) call) so the trace/span records the warning level for
this branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/DNS/Server.php`:
- Around line 200-207: The NOTIMP (unsupported opcode) return path in the opcode
check currently returns early without setting span level; add a span annotation
similar to the FORMERR paths by calling $span->set('level', 'warn') just before
creating/returning the NOTIMP response in the block that checks
$query->header->opcode !== 0 (around the Message::response(...) call) so the
trace/span records the warning level for this branch.

@loks0n loks0n merged commit c46a13c into main Feb 17, 2026
5 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

Comments