Skip to content

Conversation

@huangdijia
Copy link
Contributor

@huangdijia huangdijia commented Sep 21, 2025

Summary

  • Add FilesystemAspect class to track Flysystem adapter operations for comprehensive filesystem monitoring
  • Enable filesystem breadcrumbs and tracing spans configuration
  • Register FilesystemAspect in AOP configuration for automatic operation interception

Changes

New Files

  • src/sentry/src/Aspect/FilesystemAspect.php - New aspect class for tracking filesystem operations

Modified Files

  • src/sentry/publish/sentry.php - Added filesystem configuration options for breadcrumbs and tracing
  • src/sentry/src/ConfigProvider.php - Registered FilesystemAspect in aspects array

Features

Tracked Operations

The FilesystemAspect tracks all major Flysystem adapter operations:

  • Write operations: write, writeStream
  • Read operations: read, readStream, listContents
  • File management: delete, move, copy, setVisibility
  • Directory operations: createDirectory, deleteDirectory
  • File checks: fileExists, directoryExists, has
  • Metadata: lastModified, fileSize, mimeType, visibility

Configuration

Two new environment variables for fine-grained control:

  • SENTRY_BREADCRUMBS_FILESYSTEM - Enable/disable filesystem breadcrumbs (default: true)
  • SENTRY_TRACING_SPANS_FILESYSTEM - Enable/disable filesystem tracing spans (default: true)

Test plan

  • Verify FilesystemAspect is registered correctly in dependency injection
  • Test breadcrumb generation for filesystem operations
  • Test tracing span creation for filesystem operations
  • Verify configuration options work as expected
  • Test with different Flysystem adapters (Local, S3, etc.)

Summary by CodeRabbit

  • 新功能
    • 新增文件系统操作面包屑采集,默认开启,可通过环境变量 SENTRY_BREADCRUMBS_FILESYSTEM 控制。
    • 新增文件系统操作追踪跨度(spans),默认开启,可通过环境变量 SENTRY_TRACING_SPANS_FILESYSTEM 控制。
    • 自动记录常见文件操作(读/写/删除/移动/复制/元数据查询等)的描述与上下文,提升错误与性能诊断能力。
    • 将该监控集成至现有配置,可按需开启或关闭。

- Add FilesystemAspect class to track Flysystem adapter operations
- Add filesystem breadcrumbs and tracing configuration options
- Register FilesystemAspect in ConfigProvider for AOP
- Enable tracking of file operations like read, write, delete, move, copy
- Supports configuration via SENTRY_BREADCRUMBS_FILESYSTEM and SENTRY_TRACING_SPANS_FILESYSTEM env vars
@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Walkthrough

新增文件系统相关的 Sentry 集成:在发布配置中加入两个开关(breadcrumbs.filesystemtracing.spans.filesystem),新增两个 AOP Aspect(用于面包屑与追踪)拦截 Flysystem 适配器方法,并在 ConfigProvider 中注册这些 Aspect。

Changes

Cohort / File(s) Summary of changes
Config flags
src/sentry/publish/sentry.php
新增配置键 breadcrumbs.filesystem(env: SENTRY_BREADCRUMBS_FILESYSTEM,默认 true)与 tracing.spans.filesystem(env: SENTRY_TRACING_SPANS_FILESYSTEM,默认 true);并入现有 breadcrumbstracing.spans 配置结构。
Filesystem Aspects
src/sentry/src/Aspect/FilesystemAspect.php, src/sentry/src/Tracing/Aspect/FilesystemAspect.php
新增两个 Aspect:一个在面包屑层(调用 Integration::addBreadcrumb,基于方法构建 op/描述/数据),一个在追踪层(在 SpanContext 内包裹原调用,设置 op/description/data/origin)。均包含公开 $classes 列表、构造函数注入 Switcher,以及 process(ProceedingJoinPoint $proceedingJoinPoint) 方法;按方法(write/read/delete/move/copy/...)提取参数并组织数据。
Config wiring
src/sentry/src/ConfigProvider.php
在返回的 aspects 列表中加入 Aspect\\FilesystemAspect::classTracing\\Aspect\\FilesystemAspect::class,以启用新 Aspect;未更改公开方法签名。

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Caller as 调用方
    participant FS as Flysystem 适配器
    participant AOP_B as FilesystemAspect (Breadcrumbs)
    participant AOP_T as FilesystemAspect (Tracing)
    participant Switcher as Switcher (配置开关)
    participant Sentry as Sentry (Integration / Tracing)

    Caller->>FS: 调用文件系统方法()
    FS-->>AOP_B: AOP 拦截(面包屑层)process()
    AOP_B->>Switcher: 查询 breadcrumbs.filesystem
    alt breadcrumbs 开启
        AOP_B->>Sentry: addBreadcrumb(op: "file.{method}", 描述, 数据)
    end
    FS-->>AOP_T: AOP 拦截(追踪层)process()
    AOP_T->>Switcher: 查询 tracing.spans.filesystem
    alt tracing 开启
        AOP_T->>Sentry: Start Span(op:"file.{method}", description, data, origin:"auto.filesystem")
        AOP_T->>FS: ProceedingJoinPoint.process()(在 Span 内执行)
        Sentry-->>AOP_T: Finish Span
    else tracing 关闭
        AOP_T->>FS: ProceedingJoinPoint.process()(直接执行)
    end
    FS-->>Caller: 返回结果或抛出异常
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • guandeng

Poem

我在草径上跳跃一行,耳朵听见文件忙,
面包屑轻轻记步伐,追踪灯塔照远方。
AOP 护着每次动静,开关在掌心拍响,
Sentry 悄悄把路记,星光里藏着香。 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed 标题 "feat(sentry): add filesystem operations tracking with FilesystemAspect" 准确概括了 PR 的主要改动:引入 FilesystemAspect 以在 Sentry 中追踪文件系统操作(面包屑与 tracing span),且与变更摘要和目标一致。标题采用常见的 feat(scope): 描述格式,简洁明了,便于在提交历史中识别主要意图。它既具体又不冗长,因此对审阅者足够清晰。
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/sentry-filesystem-aspect

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

@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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/sentry/src/Aspect/FilesystemAspect.php (1)

48-69: 读操作的面包屑量级风险;建议可配置化/采样

当前同时拦截 read/readStream/listContents 等高频读操作,可能导致单事件面包屑过多(Sentry 默认上限),影响信噪比与体积。

建议:

  • 默认仅记录写/删/权限变更类操作;读操作通过额外开关或采样率控制;
  • 或新增白名单配置:sentry.breadcrumbs.filesystem_operations = ['write','delete',...],在 process 中判断 method 是否命中。
    如果需要,我可以补一个基于配置的白名单实现示例。
📜 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 96a89e6 and f131cf1.

📒 Files selected for processing (3)
  • src/sentry/publish/sentry.php (2 hunks)
  • src/sentry/src/Aspect/FilesystemAspect.php (1 hunks)
  • src/sentry/src/ConfigProvider.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/sentry/src/Aspect/FilesystemAspect.php (2)
src/sentry/src/Integration.php (1)
  • Integration (28-158)
src/sentry/src/Switcher.php (2)
  • Switcher (19-137)
  • isBreadcrumbEnabled (38-41)
src/sentry/src/ConfigProvider.php (1)
src/sentry/src/Aspect/FilesystemAspect.php (1)
  • FilesystemAspect (20-70)
🪛 GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

🪛 GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

🪛 GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

⏰ 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). (6)
  • 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.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
🔇 Additional comments (2)
src/sentry/publish/sentry.php (1)

66-66: 新增 breadcrumbs.filesystem 配置项:LGTM

默认开启符合预期,与 Switcher::isBreadcrumbEnabled('filesystem') 对应。

src/sentry/src/ConfigProvider.php (1)

25-25: 将 FilesystemAspect 注册进 aspects:LGTM

按现有开关设计由 Aspect 内部自检是否开启,符合项目惯例。

若计划保留 sentry.tracing.spans.filesystem,请确认是否也需要注册 Tracing\Aspect\FilesystemAspect(目前未见该类)。一旦实现,可在此处追加:

                 Tracing\Aspect\ElasticsearchAspect::class,
+                Tracing\Aspect\FilesystemAspect::class,
                 Tracing\Aspect\GrpcAspect::class,

Copy link

@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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/sentry/src/Aspect/FilesystemAspect.php (2)

58-74: 调整描述构建逻辑以匹配实际参数结构

由于 FilesystemAdapter 方法的参数结构,需要调整参数访问方式。大多数方法的第一个参数是 path,应该使用索引访问而不是关联数组键名。

更新描述构建逻辑:

         $description = match ($method) {
-            'move', 'copy' => sprintf(
-                'from "%s" to "%s"',
-                $arguments['source'] ?? '',
-                $arguments['destination'] ?? ''
-            ),
             'write', 'writeStream',
             'read', 'readStream',
             'setVisibility', 'visibility',
             'delete', 'deleteDirectory', 'createDirectory',
             'fileExists', 'directoryExists',
             'listContents',
             'lastModified',
             'fileSize',
-            'mimeType', => $arguments['path'] ?? '',
+            'mimeType' => $arguments[0] ?? '',
             default => '',
         };

75-107: 更新数据构建逻辑以使用正确的参数访问方式

同样需要调整数据构建部分的参数访问方式,使用数组索引而不是关联键名来访问方法参数。

更新数据构建逻辑:

         $data = match ($method) {
-            'move', 'copy' => [
-                'from' => $arguments['source'] ?? '',
-                'to' => $arguments['destination'] ?? '',
-            ],
             'write', 'writeStream' => [
-                'path' => $arguments['path'] ?? '',
-                'config' => $arguments['config'] ?? null,
+                'path' => $arguments[0] ?? '',
+                'config' => $arguments[2] ?? null,
             ],
             'read', 'readStream' => [
-                'path' => $arguments['path'] ?? '',
+                'path' => $arguments[0] ?? '',
             ],
             'setVisibility' => [
-                'path' => $arguments['path'] ?? '',
-                'visibility' => $arguments['visibility'] ?? '',
+                'path' => $arguments[0] ?? '',
+                'visibility' => $arguments[1] ?? '',
             ],
             'visibility',
             'delete', 'deleteDirectory' => [
-                'path' => $arguments['path'] ?? '',
+                'path' => $arguments[0] ?? '',
             ],
             'createDirectory' => [
-                'path' => $arguments['path'] ?? '',
-                'config' => $arguments['config'] ?? null,
+                'path' => $arguments[0] ?? '',
+                'config' => $arguments[1] ?? null,
             ],
             'fileExists', 'directoryExists',
             'listContents',
             'lastModified',
             'fileSize',
             'mimeType' => [
-                'path' => $arguments['path'] ?? '',
+                'path' => $arguments[0] ?? '',
             ],
             default => [],
         };
📜 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 f131cf1 and 745baf8.

📒 Files selected for processing (1)
  • src/sentry/src/Aspect/FilesystemAspect.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/sentry/src/Aspect/FilesystemAspect.php (2)
src/sentry/src/Integration.php (1)
  • Integration (28-158)
src/sentry/src/Switcher.php (2)
  • Switcher (19-137)
  • isBreadcrumbEnabled (38-41)
🪛 GitHub Check: Test on PHP 8.1 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

🪛 GitHub Check: Test on PHP 8.2 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

🪛 GitHub Check: Test on PHP 8.3 with Swoole 6.0.2
src/sentry/src/Aspect/FilesystemAspect.php

[failure] 22-22:
Property FriendsOfHyperf\Sentry\Aspect\FilesystemAspect::$classes overriding property Hyperf\Di\Aop\AbstractAspect::$classes (array) should also have native type array.

⏰ 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). (6)
  • GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
  • 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.2 with Swoole 5.1.7
🔇 Additional comments (6)
src/sentry/src/Aspect/FilesystemAspect.php (6)

43-46: 构造函数实现正确

构造函数正确地注入了 Switcher 依赖,使用了 PHP 8.0+ 的构造器属性推广语法,符合现代 PHP 编程实践。


109-117: 面包屑记录和方法执行逻辑正确

面包屑的创建和记录方式正确,使用了适当的级别和类型。最后调用原始方法执行也是正确的做法。


22-22: 修复类型声明以匹配父类

需要为 $classes 属性添加 array 类型声明以匹配父类 AbstractAspect 的类型提示,否则在 PHP 8.1+ 下会导致 CI 失败。

应用此修复:

-    public $classes = [
+    public array $classes = [

23-23: 移除不存在的适配器方法拦截

根据 Flysystem v3 的 FilesystemAdapter 接口定义,该接口包含 fileExists、directoryExists、write、writeStream、read 等方法,但不包含 move、copy 和 has 方法。has 方法已被 fileExists 和 directoryExists 替代,而 move 和 copy 操作在 FilesystemOperator 层实现,其中 move 调用 copy 和 delete 方法。

$classes 数组中移除不存在的方法:

         'League\Flysystem\*\*Adapter::listContents',
-        'League\Flysystem\*\*Adapter::move',
-        'League\Flysystem\*\*Adapter::copy',

如果需要拦截 move/copy 操作,应改为拦截 FilesystemOperator 层的方法。另外第 23 行已经包含了 directoryExists,因此不需要添加 has 方法的拦截。

Also applies to: 37-38


50-52: 确认:配置键 'filesystem' 与发布配置一致

在 src/sentry/publish/sentry.php 的 breadcrumbs 下存在 'filesystem' => env('SENTRY_BREADCRUMBS_FILESYSTEM', true),且 src/sentry/src/Switcher.php::isBreadcrumbEnabled 通过 'sentry.breadcrumbs.' . $key 读取配置 — 无需修改。


55-55: 修正参数获取方式

参数获取方式不正确。应该直接使用 $proceedingJoinPoint->arguments 获取方法参数,而不是 $proceedingJoinPoint->arguments['keys']

修复参数获取:

-        $arguments = $proceedingJoinPoint->arguments['keys'] ?? [];
+        $arguments = $proceedingJoinPoint->arguments;

Likely an incorrect or invalid review comment.

Copy link

@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.

Actionable comments posted: 3

🧹 Nitpick comments (2)
src/sentry/src/Tracing/Aspect/FilesystemAspect.php (2)

55-58: 补充 op 规范性建议(可选)

file.{method} 已可用;如需在 Sentry 中更好检索,可考虑将目录操作统一为 file.dir.{method}(如 file.dir.createfile.dir.delete),但非阻断。


111-118: 在 Span data 中附带适配器/实现类名(可选)

为便于排查不同适配器(Local/S3/OSS)差异,建议在 data 里加上实现类名,如:

-        return trace(
-            fn () => $proceedingJoinPoint->process(),
+        $data['class'] = $proceedingJoinPoint->className ?? null;
+        return trace(
+            static fn () => $proceedingJoinPoint->process(),
             SpanContext::make()
                 ->setOp($op)
                 ->setData($data)
                 ->setOrigin('auto.filesystem')
                 ->setDescription($description)
         );

className 不可用,可改用 get_class($proceedingJoinPoint->getInstance())(按 Hyperf 版本选择)。

📜 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 745baf8 and 86a2122.

📒 Files selected for processing (2)
  • src/sentry/src/ConfigProvider.php (2 hunks)
  • src/sentry/src/Tracing/Aspect/FilesystemAspect.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/sentry/src/ConfigProvider.php
🧰 Additional context used
🧬 Code graph analysis (1)
src/sentry/src/Tracing/Aspect/FilesystemAspect.php (1)
src/sentry/src/Switcher.php (2)
  • Switcher (19-137)
  • isTracingEnabled (51-58)
⏰ 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). (6)
  • 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.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.1 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.2 with Swoole 5.1.7
  • GitHub Check: Test on PHP 8.3 with Swoole 5.1.7
🔇 Additional comments (1)
src/sentry/src/Tracing/Aspect/FilesystemAspect.php (1)

49-54: 配置键路径需核对:Switcher::isTracingEnabled('filesystem') 使用的 key 与发布配置是否一致?

Switcher::isTracingEnabled() 读取 sentry.tracing.enable.{key};PR 描述里环境变量为 SENTRY_TRACING_SPANS_FILESYSTEM(spans),容易与 enable 路径不一致,导致开关无法生效或误判。请确认发布配置 sentry.php 中是否将该环境变量映射到 sentry.tracing.enable.filesystem,或相应调整 Switcher/配置键名以保持一致。

@huangdijia
Copy link
Contributor Author

PR #915 代码审查报告

1. 变更摘要

  • 新增文件系统监控功能:为 Sentry 组件新增了 FilesystemAspect 类,用于追踪 Flysystem 适配器的文件系统操作
  • 配置选项:添加了两个环境变量配置项
    • SENTRY_BREADCRUMBS_FILESYSTEM(默认开启):控制文件系统面包屑记录
    • SENTRY_TRACING_SPANS_FILESYSTEM(默认开启):控制文件系统追踪跨度
  • AOP 集成:在 ConfigProvider 中注册了 FilesystemAspect,实现自动拦截

2. 潜在风险

性能风险

  • 高频操作影响:拦截 readreadStreamlistContents 等高频读操作可能产生大量面包屑,影响性能和 Sentry 配额
  • 配置路径不一致:TracingAspect 中使用 isTracingEnabled('filesystem') 读取的配置路径与发布配置中的环境变量不匹配,可能导致开关失效

代码质量问题

  • 类型声明缺失FilesystemAspect::$classes 属性缺少 array 类型声明,在 PHP 8.1+ 环境下导致 CI 失败(已在最新提交中修复)
  • 参数访问方式:使用 $proceedingJoinPoint->arguments['keys'] 访问参数可能不正确,应直接使用 $proceedingJoinPoint->arguments

维护性风险

  • 不存在的方法拦截:拦截了 Flysystem 适配器接口中不存在的 movecopy 方法,这些方法在 FilesystemOperator 层实现

3. 优化建议

性能优化

  • 添加操作类型过滤:建议新增配置选项,允许用户选择监控哪些操作类型
    'filesystem_operations' => ['write', 'delete', 'createDirectory'] // 仅监控写操作
  • 采样率控制:对高频读操作实施采样率控制,避免面包屑过载

配置修复

  • 修正配置映射:确保 SENTRY_TRACING_SPANS_FILESYSTEM 正确映射到 sentry.tracing.enable.filesystem 路径

代码完善

  • 移除无效拦截:从 $classes 数组中移除 movecopy 方法的拦截
  • 增强元数据:在追踪数据中添加适配器类型信息,便于区分不同存储后端(Local/S3/OSS)的性能差异

4. 合规性检查

代码风格 ✅

  • 遵循项目的命名约定和代码格式规范
  • 正确使用了 PHP 8.0+ 的构造器属性推广语法
  • 使用了现代 PHP 的 match 表达式和 #[Override] 属性

模块边界 ✅

  • 正确继承了 AbstractAspect 基类
  • 通过依赖注入使用 Switcher 组件
  • 遵循了项目的 AOP 实现模式

文档规范 ✅

  • 包含了完整的文件头注释和命名空间声明
  • 方法签名包含了适当的类型注解

总结

此 PR 为 Sentry 组件增加了有价值的文件系统监控功能,整体设计合理。主要问题集中在配置路径一致性和性能优化方面。建议在合并前解决配置问题,并考虑添加操作类型过滤功能以提升实用性。

@huangdijia huangdijia merged commit b28a24c into main Sep 21, 2025
16 checks passed
@huangdijia huangdijia deleted the feat/sentry-filesystem-aspect branch September 21, 2025 01:58
huangdijia added a commit that referenced this pull request Sep 21, 2025
#915)

* feat(sentry): add filesystem operations tracking with FilesystemAspect

- Add FilesystemAspect class to track Flysystem adapter operations
- Add filesystem breadcrumbs and tracing configuration options
- Register FilesystemAspect in ConfigProvider for AOP
- Enable tracking of file operations like read, write, delete, move, copy
- Supports configuration via SENTRY_BREADCRUMBS_FILESYSTEM and SENTRY_TRACING_SPANS_FILESYSTEM env vars

* refactor(sentry): reorganize filesystem methods and enhance breadcrumb data structure

* chore(sentry): add comment placeholder for additional adapter methods in FilesystemAspect

* feat(sentry): add FilesystemAspect for tracking filesystem operations

* refactor(sentry): simplify FilesystemAspect by extending base class and extracting metadata logic

* refactor(sentry): update FilesystemAspect property and constructor syntax for clarity

* refactor(sentry): add #[Override] attribute to process method in FilesystemAspect for clarity

* refactor(sentry): add 'fileExists' method to FilesystemAspect class for completeness

* refactor(sentry): add 'config' argument to move and copy operations in FilesystemAspect for improved flexibility

* refactor(sentry): enhance metadata handling in FilesystemAspect for move and copy operations

---------

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