Skip to content

Conversation

@huangdijia
Copy link
Contributor

@huangdijia huangdijia commented Oct 20, 2025

Summary

This PR corrects the sentry.origin attribute value in the Monolog LogsHandler to comply with Sentry's semantic conventions.

Changes

  • Changed sentry.origin from auto.logger.monolog to auto.log.monolog in src/sentry/src/Monolog/LogsHandler.php:63

Rationale

According to Sentry's semantic conventions, the origin value for log instrumentation should use auto.log.* instead of auto.logger.* to properly identify the instrumentation type. This ensures consistency with Sentry's telemetry standards and improves observability data quality.

Test Plan

  • Verify that logs are still being sent to Sentry correctly
  • Confirm the sentry.origin attribute appears as auto.log.monolog in Sentry UI
  • Check that existing log handling functionality remains unchanged

fix:#965

Summary by CodeRabbit

发布说明

  • Bug Fixes
    • 改进了 Sentry Monolog 集成中日志元数据的标识方式,确保日志在聚合时的来源信息更加准确。

Changes sentry.origin from 'auto.logger.monolog' to 'auto.log.monolog'
to comply with Sentry's semantic conventions for log instrumentation.

According to Sentry's semantic conventions, the origin value for logs
should use 'log' instead of 'logger' to properly identify the
instrumentation type.
@coderabbitai
Copy link

coderabbitai bot commented Oct 20, 2025

概览

修改了 Sentry Monolog 集成中的来源元数据。将传递给日志聚合器的上下文中的 'sentry.origin' 值从 'auto.logger.monolog' 变更为 'auto.log.monolog'。控制流和错误处理逻辑保持不变。

变更

内聚体 / 文件 变更摘要
Sentry Monolog 日志处理器元数据更新
src/sentry/src/Monolog/LogsHandler.php
将上下文中的 'sentry.origin' 值从 'auto.logger.monolog' 更新为 'auto.log.monolog'

估计代码审查工作量

🎯 1 (微小) | ⏱️ ~3 分钟

相关的 Pull Request

🐰 一点修改,元数据微调,
从"logger"到"log",名称更贴切,
Monolog 集成更清晰,
Sentry 追踪更精准,
小改变,大精确! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed PR标题"fix(sentry): correct origin semantic convention for Monolog handler"直接且准确地反映了变更的核心内容。根据raw_summary,本次改动的主要目的是将Monolog处理器中的sentry.origin值从auto.logger.monolog更正为auto.log.monolog,以符合Sentry的语义约定。标题中的"correct origin semantic convention"清晰地表达了这一修正意图,并通过"fix"标记明确了这是一项错误修正。标题简洁明了,足以让团队成员快速理解主要改动。
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ 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 fix/sentry-origin-semantic-convention

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5ae4fe and 1828c36.

📒 Files selected for processing (1)
  • src/sentry/src/Monolog/LogsHandler.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/*/src/**/*.php

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

All component PHP code must use the namespace pattern FriendsOfHyperf{ComponentName}

Files:

  • src/sentry/src/Monolog/LogsHandler.php
**/*.php

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.php: Code style must follow PSR-12 and be formatted by PHP-CS-Fixer per .php-cs-fixer.php
Run PHPStan and keep the codebase passing per phpstan.neon.dist

Files:

  • src/sentry/src/Monolog/LogsHandler.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
  • GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
  • GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
  • GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
  • GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
  • GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
  • GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
🔇 Additional comments (1)
src/sentry/src/Monolog/LogsHandler.php (1)

63-63: sentry.origin 属性值更新已验证正确

根据 Sentry 的语义约定,使用点分形式的标识符(如 "auto.log")记录自动工具化的日志源。该更改将值从 'auto.logger.monolog' 更新为 'auto.log.monolog' 符合 Sentry 的文档规范。代码库中无其他使用 auto.logger. 模式的地方,无需进一步更新。

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.1.31)

At least one path must be specified to analyse.


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.

@huangdijia huangdijia requested a review from Copilot October 20, 2025 13:25
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 corrects the sentry.origin semantic convention value in the Monolog LogsHandler to align with Sentry's official telemetry standards. The change updates the origin identifier from auto.logger.monolog to auto.log.monolog, ensuring proper categorization of log instrumentation in Sentry's observability platform.

Key Changes:

  • Updated the sentry.origin attribute value to use the correct semantic convention format (auto.log.* instead of auto.logger.*)

@huangdijia huangdijia merged commit 70b3474 into main Oct 20, 2025
17 checks passed
@huangdijia huangdijia deleted the fix/sentry-origin-semantic-convention branch October 20, 2025 13:33
huangdijia added a commit that referenced this pull request Oct 20, 2025
…965)

Changes sentry.origin from 'auto.logger.monolog' to 'auto.log.monolog'
to comply with Sentry's semantic conventions for log instrumentation.

According to Sentry's semantic conventions, the origin value for logs
should use 'log' instead of 'logger' to properly identify the
instrumentation type.

Co-authored-by: Deeka Wong <8337659+huangdijia@users.noreply.github.com>
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