aury-boot 0.0.39__tar.gz → 0.0.41__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. {aury_boot-0.0.39 → aury_boot-0.0.41}/PKG-INFO +14 -4
  2. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/_version.py +2 -2
  3. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/http.py +17 -6
  4. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/app/base.py +1 -0
  5. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/app/components.py +93 -3
  6. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/config/settings.py +80 -2
  7. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/init.py +20 -0
  8. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/pkg.py +31 -1
  9. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/00-overview.md.tpl +1 -0
  10. aury_boot-0.0.41/aury/boot/commands/templates/project/aury_docs/18-monitoring-profiling.md.tpl +239 -0
  11. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/monitoring.tpl +15 -0
  12. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/logging/setup.py +8 -3
  13. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/redis.py +82 -16
  14. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/channel/__init__.py +2 -1
  15. aury_boot-0.0.41/aury/boot/infrastructure/channel/backends/__init__.py +6 -0
  16. aury_boot-0.0.41/aury/boot/infrastructure/channel/backends/redis_cluster.py +124 -0
  17. aury_boot-0.0.41/aury/boot/infrastructure/channel/backends/redis_cluster_channel.py +139 -0
  18. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/channel/base.py +2 -0
  19. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/channel/manager.py +9 -1
  20. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/redis/manager.py +90 -19
  21. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/manager.py +6 -4
  22. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/__init__.py +10 -2
  23. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/notifiers/feishu.py +33 -16
  24. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/notifiers/webhook.py +14 -13
  25. aury_boot-0.0.41/aury/boot/infrastructure/monitoring/profiling/__init__.py +664 -0
  26. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/scheduler/__init__.py +2 -0
  27. aury_boot-0.0.41/aury/boot/infrastructure/scheduler/jobstores/__init__.py +10 -0
  28. aury_boot-0.0.41/aury/boot/infrastructure/scheduler/jobstores/redis_cluster.py +255 -0
  29. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/scheduler/manager.py +15 -3
  30. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/toolkit/http/__init__.py +180 -85
  31. {aury_boot-0.0.39 → aury_boot-0.0.41}/pyproject.toml +17 -3
  32. aury_boot-0.0.39/aury/boot/infrastructure/channel/backends/__init__.py +0 -5
  33. {aury_boot-0.0.39 → aury_boot-0.0.41}/.gitignore +0 -0
  34. {aury_boot-0.0.39 → aury_boot-0.0.41}/README.md +0 -0
  35. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/__init__.py +0 -0
  36. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/__init__.py +0 -0
  37. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/__init__.py +0 -0
  38. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/base.py +0 -0
  39. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/config.py +0 -0
  40. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/decorators.py +0 -0
  41. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/adapter/exceptions.py +0 -0
  42. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/app/__init__.py +0 -0
  43. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/app/middlewares.py +0 -0
  44. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/app/startup.py +0 -0
  45. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/config/__init__.py +0 -0
  46. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/config/multi_instance.py +0 -0
  47. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/constants/__init__.py +0 -0
  48. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/constants/components.py +0 -0
  49. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/constants/scheduler.py +0 -0
  50. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/constants/service.py +0 -0
  51. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/__init__.py +0 -0
  52. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/chain.py +0 -0
  53. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/codes.py +0 -0
  54. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/exceptions.py +0 -0
  55. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/handlers.py +0 -0
  56. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/errors/response.py +0 -0
  57. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/interfaces/__init__.py +0 -0
  58. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/interfaces/egress.py +0 -0
  59. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/interfaces/ingress.py +0 -0
  60. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/middleware/__init__.py +0 -0
  61. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/middleware/logging.py +0 -0
  62. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/migrations/__init__.py +0 -0
  63. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/migrations/manager.py +0 -0
  64. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/migrations/setup.py +0 -0
  65. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/rpc/__init__.py +0 -0
  66. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/rpc/base.py +0 -0
  67. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/rpc/client.py +0 -0
  68. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/rpc/discovery.py +0 -0
  69. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/scheduler/__init__.py +0 -0
  70. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/scheduler/runner.py +0 -0
  71. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/application/server/__init__.py +0 -0
  72. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/__init__.py +0 -0
  73. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/add.py +0 -0
  74. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/app.py +0 -0
  75. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/config.py +0 -0
  76. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/docker.py +0 -0
  77. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/docs.py +0 -0
  78. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/generate.py +0 -0
  79. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/migrate/__init__.py +0 -0
  80. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/migrate/app.py +0 -0
  81. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/migrate/commands.py +0 -0
  82. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/scheduler.py +0 -0
  83. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/server/__init__.py +0 -0
  84. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/server/app.py +0 -0
  85. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/generate/api.py.tpl +0 -0
  86. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/generate/model.py.tpl +0 -0
  87. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/generate/repository.py.tpl +0 -0
  88. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/generate/schema.py.tpl +0 -0
  89. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/generate/service.py.tpl +0 -0
  90. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/AGENTS.md.tpl +0 -0
  91. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/README.md.tpl +0 -0
  92. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/admin_console_init.py.tpl +0 -0
  93. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/alert_rules.example.yaml.tpl +0 -0
  94. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/01-model.md.tpl +0 -0
  95. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/02-repository.md.tpl +0 -0
  96. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/03-service.md.tpl +0 -0
  97. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/04-schema.md.tpl +0 -0
  98. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/05-api.md.tpl +0 -0
  99. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/06-exception.md.tpl +0 -0
  100. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/07-cache.md.tpl +0 -0
  101. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/08-scheduler.md.tpl +0 -0
  102. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/09-tasks.md.tpl +0 -0
  103. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/10-storage.md.tpl +0 -0
  104. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/11-logging.md.tpl +0 -0
  105. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/12-admin.md.tpl +0 -0
  106. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/13-channel.md.tpl +0 -0
  107. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/14-mq.md.tpl +0 -0
  108. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/15-events.md.tpl +0 -0
  109. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/16-adapter.md.tpl +0 -0
  110. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/17-alerting.md.tpl +0 -0
  111. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/aury_docs/99-cli.md.tpl +0 -0
  112. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/config.py.tpl +0 -0
  113. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/conftest.py.tpl +0 -0
  114. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/_header.tpl +0 -0
  115. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/admin.tpl +0 -0
  116. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/cache.tpl +0 -0
  117. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/database.tpl +0 -0
  118. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/log.tpl +0 -0
  119. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/messaging.tpl +0 -0
  120. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/rpc.tpl +0 -0
  121. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/scheduler.tpl +0 -0
  122. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/service.tpl +0 -0
  123. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/storage.tpl +0 -0
  124. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/env_templates/third_party.tpl +0 -0
  125. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/gitignore.tpl +0 -0
  126. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/main.py.tpl +0 -0
  127. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/modules/api.py.tpl +0 -0
  128. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/modules/exceptions.py.tpl +0 -0
  129. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/modules/schedules.py.tpl +0 -0
  130. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/templates/project/modules/tasks.py.tpl +0 -0
  131. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/commands/worker.py +0 -0
  132. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/__init__.py +0 -0
  133. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/exceptions/__init__.py +0 -0
  134. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/i18n/__init__.py +0 -0
  135. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/i18n/translator.py +0 -0
  136. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/logging/__init__.py +0 -0
  137. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/logging/context.py +0 -0
  138. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/logging/decorators.py +0 -0
  139. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/common/logging/format.py +0 -0
  140. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/__init__.py +0 -0
  141. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/admin_console/__init__.py +0 -0
  142. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/admin_console/auth.py +0 -0
  143. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/admin_console/discovery.py +0 -0
  144. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/admin_console/install.py +0 -0
  145. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/contrib/admin_console/utils.py +0 -0
  146. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/__init__.py +0 -0
  147. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/exceptions/__init__.py +0 -0
  148. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/models/__init__.py +0 -0
  149. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/models/base.py +0 -0
  150. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/models/mixins.py +0 -0
  151. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/models/models.py +0 -0
  152. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/pagination/__init__.py +0 -0
  153. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/repository/__init__.py +0 -0
  154. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/repository/impl.py +0 -0
  155. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/repository/interceptors.py +0 -0
  156. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/repository/interface.py +0 -0
  157. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/repository/query_builder.py +0 -0
  158. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/service/__init__.py +0 -0
  159. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/service/base.py +0 -0
  160. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/domain/transaction/__init__.py +0 -0
  161. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/__init__.py +0 -0
  162. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/__init__.py +0 -0
  163. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/backends.py +0 -0
  164. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/base.py +0 -0
  165. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/exceptions.py +0 -0
  166. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/factory.py +0 -0
  167. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/manager.py +0 -0
  168. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/cache/memory.py +0 -0
  169. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/channel/backends/broadcaster.py +0 -0
  170. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/__init__.py +0 -0
  171. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/rabbitmq/__init__.py +0 -0
  172. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/rabbitmq/config.py +0 -0
  173. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/rabbitmq/manager.py +0 -0
  174. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/redis/__init__.py +0 -0
  175. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/clients/redis/config.py +0 -0
  176. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/__init__.py +0 -0
  177. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/config.py +0 -0
  178. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/exceptions.py +0 -0
  179. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/query_tools/__init__.py +0 -0
  180. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/database/strategies/__init__.py +0 -0
  181. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/di/__init__.py +0 -0
  182. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/di/container.py +0 -0
  183. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/__init__.py +0 -0
  184. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/backends/__init__.py +0 -0
  185. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/backends/broadcaster.py +0 -0
  186. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/backends/rabbitmq.py +0 -0
  187. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/base.py +0 -0
  188. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/manager.py +0 -0
  189. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/events/middleware.py +0 -0
  190. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/__init__.py +0 -0
  191. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/aggregator.py +0 -0
  192. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/events.py +0 -0
  193. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/manager.py +0 -0
  194. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/notifiers/__init__.py +0 -0
  195. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/notifiers/base.py +0 -0
  196. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/alerting/rules.py +0 -0
  197. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/health/__init__.py +0 -0
  198. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/__init__.py +0 -0
  199. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/context.py +0 -0
  200. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/logging.py +0 -0
  201. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/processor.py +0 -0
  202. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/provider.py +0 -0
  203. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/monitoring/tracing/tracing.py +0 -0
  204. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/__init__.py +0 -0
  205. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/backends/__init__.py +0 -0
  206. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/backends/rabbitmq.py +0 -0
  207. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/backends/redis.py +0 -0
  208. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/backends/redis_stream.py +0 -0
  209. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/base.py +0 -0
  210. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/mq/manager.py +0 -0
  211. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/scheduler/exceptions.py +0 -0
  212. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/storage/__init__.py +0 -0
  213. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/storage/base.py +0 -0
  214. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/storage/exceptions.py +0 -0
  215. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/storage/factory.py +0 -0
  216. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/tasks/__init__.py +0 -0
  217. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/tasks/config.py +0 -0
  218. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/tasks/constants.py +0 -0
  219. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/tasks/exceptions.py +0 -0
  220. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/infrastructure/tasks/manager.py +0 -0
  221. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/testing/__init__.py +0 -0
  222. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/testing/base.py +0 -0
  223. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/testing/client.py +0 -0
  224. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/testing/factory.py +0 -0
  225. {aury_boot-0.0.39 → aury_boot-0.0.41}/aury/boot/toolkit/__init__.py +0 -0
@@ -1,8 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aury-boot
3
- Version: 0.0.39
3
+ Version: 0.0.41
4
4
  Summary: Aury Boot - 基于 FastAPI 生态的企业级 API 开发框架
5
5
  Requires-Python: >=3.13
6
+ Requires-Dist: aiohttp>=3.11.0
6
7
  Requires-Dist: alembic>=1.17.2
7
8
  Requires-Dist: aury-sdk-storage[aws]>=0.0.6
8
9
  Requires-Dist: babel>=2.17.0
@@ -10,7 +11,6 @@ Requires-Dist: broadcaster[redis]>=0.3.1
10
11
  Requires-Dist: faker>=38.2.0
11
12
  Requires-Dist: fastapi>=0.122.0
12
13
  Requires-Dist: greenlet>=3.2.4
13
- Requires-Dist: httpx>=0.28.1
14
14
  Requires-Dist: loguru>=0.7.3
15
15
  Requires-Dist: pydantic-settings>=2.12.0
16
16
  Requires-Dist: pydantic>=2.12.5
@@ -28,12 +28,18 @@ Requires-Dist: aiosqlite>=0.21.0; extra == 'all'
28
28
  Requires-Dist: apscheduler>=3.11.1; extra == 'all'
29
29
  Requires-Dist: asyncpg>=0.31.0; extra == 'all'
30
30
  Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 'all'
31
+ Requires-Dist: coredis>=5.6.0; extra == 'all'
31
32
  Requires-Dist: dramatiq>=1.18.0; extra == 'all'
32
33
  Requires-Dist: pika>=1.3.2; extra == 'all'
34
+ Requires-Dist: psutil>=7.0.0; extra == 'all'
35
+ Requires-Dist: pyroscope-io>=0.8.7; extra == 'all'
33
36
  Requires-Dist: redis>=7.1.0; extra == 'all'
34
37
  Provides-Extra: broadcaster
35
38
  Requires-Dist: broadcaster[redis]>=0.3.1; extra == 'broadcaster'
39
+ Provides-Extra: channel-cluster
40
+ Requires-Dist: coredis>=5.6.0; extra == 'channel-cluster'
36
41
  Provides-Extra: dev
42
+ Requires-Dist: httpx>=0.28.1; extra == 'dev'
37
43
  Requires-Dist: mypy>=1.19.0; extra == 'dev'
38
44
  Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
39
45
  Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
@@ -47,14 +53,17 @@ Provides-Extra: mysql
47
53
  Requires-Dist: aiomysql>=0.3.2; extra == 'mysql'
48
54
  Provides-Extra: otel
49
55
  Requires-Dist: opentelemetry-api>=1.25.0; extra == 'otel'
56
+ Requires-Dist: opentelemetry-instrumentation-aiohttp-client>=0.46b0; extra == 'otel'
50
57
  Requires-Dist: opentelemetry-instrumentation-fastapi>=0.46b0; extra == 'otel'
51
- Requires-Dist: opentelemetry-instrumentation-httpx>=0.46b0; extra == 'otel'
52
58
  Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.46b0; extra == 'otel'
53
59
  Requires-Dist: opentelemetry-sdk>=1.25.0; extra == 'otel'
54
60
  Provides-Extra: otel-exporter
55
61
  Requires-Dist: opentelemetry-exporter-otlp>=1.25.0; extra == 'otel-exporter'
56
62
  Provides-Extra: postgres
57
63
  Requires-Dist: asyncpg>=0.31.0; extra == 'postgres'
64
+ Provides-Extra: profiling
65
+ Requires-Dist: psutil>=7.0.0; extra == 'profiling'
66
+ Requires-Dist: pyroscope-io>=0.8.7; extra == 'profiling'
58
67
  Provides-Extra: rabbitmq
59
68
  Requires-Dist: amqp>=5.3.1; extra == 'rabbitmq'
60
69
  Provides-Extra: recommended
@@ -62,10 +71,11 @@ Requires-Dist: aiosqlite>=0.21.0; extra == 'recommended'
62
71
  Requires-Dist: apscheduler>=3.11.1; extra == 'recommended'
63
72
  Requires-Dist: asyncpg>=0.31.0; extra == 'recommended'
64
73
  Requires-Dist: aury-sdk-storage[aws]>=0.0.1; extra == 'recommended'
74
+ Requires-Dist: coredis>=5.6.0; extra == 'recommended'
65
75
  Requires-Dist: dramatiq>=1.18.0; extra == 'recommended'
66
76
  Requires-Dist: opentelemetry-api>=1.25.0; extra == 'recommended'
77
+ Requires-Dist: opentelemetry-instrumentation-aiohttp-client>=0.46b0; extra == 'recommended'
67
78
  Requires-Dist: opentelemetry-instrumentation-fastapi>=0.46b0; extra == 'recommended'
68
- Requires-Dist: opentelemetry-instrumentation-httpx>=0.46b0; extra == 'recommended'
69
79
  Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.46b0; extra == 'recommended'
70
80
  Requires-Dist: opentelemetry-sdk>=1.25.0; extra == 'recommended'
71
81
  Requires-Dist: redis>=7.1.0; extra == 'recommended'
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.0.39'
32
- __version_tuple__ = version_tuple = (0, 0, 39)
31
+ __version__ = version = '0.0.41'
32
+ __version_tuple__ = version_tuple = (0, 0, 41)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -25,10 +25,14 @@ from __future__ import annotations
25
25
 
26
26
  from typing import Any
27
27
 
28
- import httpx
29
-
30
28
  from aury.boot.common.logging import get_trace_id, logger
31
- from aury.boot.toolkit.http import HttpClient, RetryConfig
29
+ from aury.boot.toolkit.http import (
30
+ HttpClient,
31
+ HttpNetworkError,
32
+ HttpStatusError,
33
+ HttpTimeoutError,
34
+ RetryConfig,
35
+ )
32
36
 
33
37
  from .base import BaseAdapter
34
38
  from .config import AdapterSettings
@@ -185,7 +189,7 @@ class HttpAdapter(BaseAdapter):
185
189
  json: JSON 请求体
186
190
  data: 表单数据
187
191
  files: 上传文件
188
- **kwargs: 其他 httpx 参数
192
+ **kwargs: 其他 aiohttp 参数
189
193
 
190
194
  Returns:
191
195
  dict: 响应 JSON
@@ -228,7 +232,7 @@ class HttpAdapter(BaseAdapter):
228
232
  "content": response.text,
229
233
  }
230
234
 
231
- except httpx.TimeoutException as exc:
235
+ except HttpTimeoutError as exc:
232
236
  raise AdapterTimeoutError(
233
237
  f"请求超时: {method} {path}",
234
238
  adapter_name=self.name,
@@ -236,7 +240,7 @@ class HttpAdapter(BaseAdapter):
236
240
  cause=exc,
237
241
  ) from exc
238
242
 
239
- except httpx.HTTPStatusError as exc:
243
+ except HttpStatusError as exc:
240
244
  # HTTP 错误状态码
241
245
  response = exc.response
242
246
  try:
@@ -255,6 +259,13 @@ class HttpAdapter(BaseAdapter):
255
259
  cause=exc,
256
260
  ) from exc
257
261
 
262
+ except HttpNetworkError as exc:
263
+ raise AdapterError(
264
+ f"网络错误: {method} {path} - {exc}",
265
+ adapter_name=self.name,
266
+ cause=exc,
267
+ ) from exc
268
+
258
269
  except Exception as exc:
259
270
  raise AdapterError(
260
271
  f"请求失败: {method} {path} - {type(exc).__name__}: {exc}",
@@ -313,6 +313,7 @@ class FoundationApp(FastAPI):
313
313
  enable_file_rotation=config.log.enable_file_rotation,
314
314
  enable_console=config.log.enable_console,
315
315
  logger_levels=logger_levels,
316
+ enqueue=config.log.enqueue,
316
317
  )
317
318
 
318
319
  # 注册 access 日志(HTTP 请求日志)
@@ -318,13 +318,37 @@ class SchedulerComponent(Component):
318
318
  # jobstores: 根据 URL 自动选择存储后端
319
319
  if scheduler_config.jobstore_url:
320
320
  url = scheduler_config.jobstore_url
321
- if url.startswith("redis://"):
321
+ if url.startswith("redis-cluster://"):
322
+ # Redis Cluster 模式
322
323
  try:
324
+ from aury.boot.infrastructure.scheduler.jobstores import RedisClusterJobStore
325
+
326
+ scheduler_kwargs["jobstores"] = {
327
+ "default": RedisClusterJobStore(url=url)
328
+ }
329
+ logger.info(f"调度器使用 Redis Cluster 存储: {url.split('@')[-1].split('/')[0]}")
330
+ except ImportError:
331
+ logger.warning("Redis Cluster jobstore 需要安装 redis[cluster]: pip install 'redis[cluster]'")
332
+ elif url.startswith("redis://"):
333
+ try:
334
+ from urllib.parse import urlparse
323
335
  from apscheduler.jobstores.redis import RedisJobStore
336
+
337
+ # 解析 Redis URL
338
+ parsed = urlparse(url)
339
+ redis_kwargs: dict = {
340
+ "host": parsed.hostname or "localhost",
341
+ "port": parsed.port or 6379,
342
+ }
343
+ if parsed.password:
344
+ redis_kwargs["password"] = parsed.password
345
+ if parsed.path and parsed.path != "/":
346
+ redis_kwargs["db"] = int(parsed.path.lstrip("/") or 0)
347
+
324
348
  scheduler_kwargs["jobstores"] = {
325
- "default": RedisJobStore.from_url(url)
349
+ "default": RedisJobStore(**redis_kwargs)
326
350
  }
327
- logger.info(f"调度器使用 Redis 存储: {url.split('@')[-1]}")
351
+ logger.info(f"调度器使用 Redis 存储: {parsed.hostname}:{parsed.port}")
328
352
  except ImportError:
329
353
  logger.warning("Redis jobstore 需要安装 redis: pip install redis")
330
354
  else:
@@ -766,6 +790,70 @@ class AlertComponent(Component):
766
790
  pass
767
791
 
768
792
 
793
+ class ProfilingComponent(Component):
794
+ """Profiling 组件。
795
+
796
+ 提供持续性能分析和事件循环阻塞检测:
797
+ - Pyroscope:持续采样生成火焰图
798
+ - 阻塞检测:检测同步代码阻塞事件循环
799
+ """
800
+
801
+ name = "profiling"
802
+ enabled = True
803
+ depends_on: ClassVar[list[str]] = ["alert"] # 告警依赖
804
+
805
+ def can_enable(self, config: BaseConfig) -> bool:
806
+ """当启用 Pyroscope 或阻塞检测时启用。"""
807
+ return self.enabled and (
808
+ config.profiling.enabled or config.profiling.blocking_detector_enabled
809
+ )
810
+
811
+ async def setup(self, app: FoundationApp, config: BaseConfig) -> None:
812
+ """初始化 Profiling 组件。"""
813
+ try:
814
+ from aury.boot.infrastructure.monitoring.profiling import (
815
+ ProfilingConfig,
816
+ ProfilingManager,
817
+ )
818
+
819
+ profiling_config = ProfilingConfig(
820
+ enabled=config.profiling.enabled,
821
+ pyroscope_endpoint=config.profiling.pyroscope_endpoint,
822
+ pyroscope_auth_token=config.profiling.pyroscope_auth_token,
823
+ service_name=config.service.name,
824
+ environment=config.service.environment,
825
+ blocking_detector_enabled=config.profiling.blocking_detector_enabled,
826
+ blocking_check_interval_ms=config.profiling.blocking_check_interval_ms,
827
+ blocking_threshold_ms=config.profiling.blocking_threshold_ms,
828
+ blocking_severe_threshold_ms=config.profiling.blocking_severe_threshold_ms,
829
+ blocking_alert_enabled=config.profiling.blocking_alert_enabled,
830
+ blocking_alert_cooldown_seconds=config.profiling.blocking_alert_cooldown_seconds,
831
+ blocking_max_history=config.profiling.blocking_max_history,
832
+ tags=config.profiling.pyroscope_tags,
833
+ )
834
+
835
+ manager = ProfilingManager.get_instance()
836
+ manager.configure(profiling_config)
837
+ await manager.start()
838
+
839
+ # 保存到 app.state
840
+ app.state.profiling_manager = manager
841
+
842
+ except ImportError as e:
843
+ logger.warning(f"Profiling 依赖未安装,跳过初始化: {e}")
844
+ except Exception as e:
845
+ logger.warning(f"Profiling 初始化失败(非关键): {e}")
846
+
847
+ async def teardown(self, app: FoundationApp) -> None:
848
+ """停止 Profiling 组件。"""
849
+ try:
850
+ manager = getattr(app.state, "profiling_manager", None)
851
+ if manager:
852
+ await manager.stop()
853
+ except Exception as e:
854
+ logger.warning(f"Profiling 关闭失败: {e}")
855
+
856
+
769
857
  class EventBusComponent(Component):
770
858
  """事件总线组件。
771
859
 
@@ -815,6 +903,7 @@ FoundationApp.plugins = [
815
903
  # 设置默认组件
816
904
  FoundationApp.components = [
817
905
  AlertComponent, # 最先初始化告警管理器
906
+ ProfilingComponent, # Profiling 依赖告警
818
907
  DatabaseComponent,
819
908
  MigrationComponent,
820
909
  AdminConsoleComponent,
@@ -837,6 +926,7 @@ __all__ = [
837
926
  "EventBusComponent",
838
927
  "MessageQueueComponent",
839
928
  "MigrationComponent",
929
+ "ProfilingComponent",
840
930
  "SchedulerComponent",
841
931
  "StorageComponent",
842
932
  "TaskComponent",
@@ -263,15 +263,19 @@ class ChannelSettings(BaseModel):
263
263
  支持的后端类型:
264
264
  - memory: 内存后端(默认,单进程)
265
265
  - redis: Redis Pub/Sub(多进程/分布式)
266
+ - redis_cluster: Redis Cluster Sharded Pub/Sub(Redis 7.0+)
267
+
268
+ 注意:URL 的 scheme 会自动决定后端类型:
269
+ - redis-cluster://... 自动使用 redis_cluster 后端
266
270
  """
267
271
 
268
272
  backend: str = Field(
269
273
  default="",
270
- description="通道后端 (memory/redis),空字符串表示不启用"
274
+ description="通道后端 (memory/redis/redis_cluster),空字符串表示不启用"
271
275
  )
272
276
  url: str | None = Field(
273
277
  default=None,
274
- description="Redis URL(当 backend=redis 时需要)"
278
+ description="连接 URL(redis://... redis-cluster://...)"
275
279
  )
276
280
 
277
281
 
@@ -401,6 +405,14 @@ class LogSettings(BaseModel):
401
405
  default=False,
402
406
  description="是否记录 WebSocket 消息内容(注意性能和敏感数据)"
403
407
  )
408
+ enqueue: bool = Field(
409
+ default=False,
410
+ description=(
411
+ "是否启用多进程安全队列。"
412
+ "启用后日志通过 multiprocessing.Queue 传输,"
413
+ "可能导致事件循环阻塞。建议在 asyncio 应用中保持 False"
414
+ )
415
+ )
404
416
 
405
417
 
406
418
  class ServiceSettings(BaseModel):
@@ -464,6 +476,7 @@ class SchedulerSettings(BaseModel):
464
476
  default=None,
465
477
  description=(
466
478
  "任务存储 URL。支持:\n"
479
+ "- redis-cluster://password@host:port(Redis Cluster 存储)\n"
467
480
  "- redis://localhost:6379/0(Redis 存储)\n"
468
481
  "- sqlite:///jobs.db(SQLite 存储)\n"
469
482
  "- postgresql://user:pass@host/db(PostgreSQL 存储)\n"
@@ -741,6 +754,70 @@ class AlertSettings(BaseModel):
741
754
  return self._notifiers
742
755
 
743
756
 
757
+ class ProfilingSettings(BaseModel):
758
+ """Profiling 配置。
759
+
760
+ 环境变量格式: PROFILING__{FIELD}
761
+ 示例: PROFILING__ENABLED, PROFILING__PYROSCOPE_ENDPOINT
762
+
763
+ 功能说明:
764
+ - Pyroscope:持续采样生成火焰图(需安装 pyroscope-io)
765
+ - 阻塞检测:检测同步代码阻塞事件循环(需安装 psutil)
766
+ """
767
+
768
+ # Pyroscope 持续 Profiling
769
+ enabled: bool = Field(
770
+ default=False,
771
+ description="是否启用 Pyroscope 持续 profiling"
772
+ )
773
+ pyroscope_endpoint: str | None = Field(
774
+ default=None,
775
+ description="Pyroscope 服务端点(如 http://pyroscope:4040)"
776
+ )
777
+ pyroscope_auth_token: str | None = Field(
778
+ default=None,
779
+ description="Pyroscope 认证 token(可选)"
780
+ )
781
+ pyroscope_sample_rate: int = Field(
782
+ default=100,
783
+ description="Pyroscope 采样率 (Hz),降低可减少开销"
784
+ )
785
+ pyroscope_tags: dict[str, str] = Field(
786
+ default_factory=dict,
787
+ description="Pyroscope 自定义标签"
788
+ )
789
+
790
+ # 事件循环阻塞检测
791
+ blocking_detector_enabled: bool = Field(
792
+ default=False,
793
+ description="是否启用事件循环阻塞检测"
794
+ )
795
+ blocking_check_interval_ms: float = Field(
796
+ default=100,
797
+ description="阻塞检测间隔 (ms)"
798
+ )
799
+ blocking_threshold_ms: float = Field(
800
+ default=100,
801
+ description="阻塞阈值 (ms),超过此时间记录阻塞事件"
802
+ )
803
+ blocking_severe_threshold_ms: float = Field(
804
+ default=500,
805
+ description="严重阻塞阈值 (ms),超过此时间触发严重告警"
806
+ )
807
+ blocking_alert_enabled: bool = Field(
808
+ default=True,
809
+ description="检测到阻塞时是否发送告警"
810
+ )
811
+ blocking_alert_cooldown_seconds: float = Field(
812
+ default=60,
813
+ description="阻塞告警冷却时间 (秒),避免告警风暴"
814
+ )
815
+ blocking_max_history: int = Field(
816
+ default=50,
817
+ description="保留的阻塞事件历史数量"
818
+ )
819
+
820
+
744
821
  class MigrationSettings(BaseModel):
745
822
  """数据库迁移配置。
746
823
 
@@ -1014,6 +1091,7 @@ class BaseConfig(BaseSettings):
1014
1091
  # ========== 监控告警 ==========
1015
1092
  telemetry: TelemetrySettings = Field(default_factory=TelemetrySettings)
1016
1093
  alert: AlertSettings = Field(default_factory=AlertSettings)
1094
+ profiling: ProfilingSettings = Field(default_factory=ProfilingSettings)
1017
1095
 
1018
1096
  model_config = SettingsConfigDict(
1019
1097
  case_sensitive=False,
@@ -542,6 +542,18 @@ def _collect_interactive_config() -> dict:
542
542
 
543
543
  config["features"] = features
544
544
 
545
+ # 5.5 监控配置
546
+ console.print()
547
+ console.print("[bold]📊 监控配置[/bold]")
548
+ config["with_otel"] = Confirm.ask(
549
+ " 启用 OpenTelemetry 链路追踪",
550
+ default=True,
551
+ )
552
+ config["with_profiling"] = Confirm.ask(
553
+ " 启用 Profiling (火焰图/阻塞检测)",
554
+ default=False,
555
+ )
556
+
545
557
  # 6. 开发工具
546
558
  console.print()
547
559
  config["with_dev"] = Confirm.ask(
@@ -589,6 +601,12 @@ def _build_dependency_list(config: dict) -> list[str]:
589
601
  if config.get("with_admin_console", True):
590
602
  extras.add("admin")
591
603
 
604
+ # 监控
605
+ if config.get("with_otel", True):
606
+ extras.add("otel")
607
+ if config.get("with_profiling", False):
608
+ extras.add("profiling")
609
+
592
610
  # 开发工具
593
611
  if config.get("with_dev"):
594
612
  extras.add("dev")
@@ -616,6 +634,8 @@ def _show_config_summary(config: dict) -> None:
616
634
  ("服务模式", config.get("service_mode", "api")),
617
635
  ("管理后台", "是" if config.get("with_admin_console", True) else "否"),
618
636
  ("可选功能", ", ".join(config.get("features", [])) or "无"),
637
+ ("OpenTelemetry", "是" if config.get("with_otel", True) else "否"),
638
+ ("Profiling", "是" if config.get("with_profiling", False) else "否"),
619
639
  ("开发工具", "是" if config.get("with_dev") else "否"),
620
640
  ("Docker", "是" if config.get("with_docker") else "否"),
621
641
  ]
@@ -45,6 +45,7 @@ class Category(str, Enum):
45
45
  SCHEDULER = "scheduler"
46
46
  ADMIN = "admin"
47
47
  STORAGE = "storage"
48
+ MONITORING = "monitoring"
48
49
  ECOSYSTEM = "ecosystem"
49
50
 
50
51
 
@@ -132,6 +133,29 @@ MODULES: dict[str, ModuleInfo] = {
132
133
  category=Category.STORAGE,
133
134
  deps=["aury-sdk-storage[aws]"],
134
135
  ),
136
+ # 监控
137
+ "otel": ModuleInfo(
138
+ name="otel",
139
+ desc="OpenTelemetry 链路追踪",
140
+ usage="启用 TELEMETRY__ENABLED 自动 instrument FastAPI/SQLAlchemy/httpx",
141
+ category=Category.MONITORING,
142
+ deps=["opentelemetry-api", "opentelemetry-sdk", "opentelemetry-instrumentation-fastapi",
143
+ "opentelemetry-instrumentation-sqlalchemy", "opentelemetry-instrumentation-httpx"],
144
+ ),
145
+ "otel-exporter": ModuleInfo(
146
+ name="otel-exporter",
147
+ desc="OpenTelemetry OTLP 导出器",
148
+ usage="导出 Traces/Metrics/Logs 到 Jaeger/Prometheus/Loki",
149
+ category=Category.MONITORING,
150
+ deps=["opentelemetry-exporter-otlp"],
151
+ ),
152
+ "profiling": ModuleInfo(
153
+ name="profiling",
154
+ desc="Profiling 性能分析",
155
+ usage="Pyroscope 火焰图 + 事件循环阻塞检测",
156
+ category=Category.MONITORING,
157
+ deps=["pyroscope-io", "psutil"],
158
+ ),
135
159
  # 生态包
136
160
  "storage-aws": ModuleInfo(
137
161
  name="storage-aws",
@@ -182,7 +206,12 @@ PRESETS: dict[str, PresetInfo] = {
182
206
  "full": PresetInfo(
183
207
  name="full",
184
208
  desc="完整功能(所有模块)",
185
- modules=["postgres", "redis", "tasks", "rabbitmq", "scheduler", "admin", "storage-cos"],
209
+ modules=["postgres", "redis", "tasks", "rabbitmq", "scheduler", "admin", "storage-cos", "otel", "profiling"],
210
+ ),
211
+ "monitoring": PresetInfo(
212
+ name="monitoring",
213
+ desc="完整监控(OTel + Profiling)",
214
+ modules=["otel", "otel-exporter", "profiling"],
186
215
  ),
187
216
  }
188
217
 
@@ -195,6 +224,7 @@ CATEGORY_NAMES: dict[Category, str] = {
195
224
  Category.SCHEDULER: "📦 定时调度",
196
225
  Category.ADMIN: "📦 管理后台",
197
226
  Category.STORAGE: "📦 对象存储",
227
+ Category.MONITORING: "📊 监控分析",
198
228
  Category.ECOSYSTEM: "🌐 生态包",
199
229
  }
200
230
 
@@ -60,3 +60,4 @@ CLI 命令参考请查看 [99-cli.md](./99-cli.md)。
60
60
 
61
61
  ### 监控与告警
62
62
  - [17-alerting.md](./17-alerting.md) - 告警系统(慢请求/慢SQL/异常 → 飞书)
63
+ - [18-monitoring-profiling.md](./18-monitoring-profiling.md) - 监控与 Profiling(火焰图/阻塞检测)