tasker-engine 1.0.0

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 (605) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +22 -0
  3. data/README.md +443 -0
  4. data/Rakefile +10 -0
  5. data/app/controllers/tasker/analytics_controller.rb +179 -0
  6. data/app/controllers/tasker/application_controller.rb +45 -0
  7. data/app/controllers/tasker/graphql_controller.rb +193 -0
  8. data/app/controllers/tasker/handlers_controller.rb +217 -0
  9. data/app/controllers/tasker/health_controller.rb +229 -0
  10. data/app/controllers/tasker/metrics_controller.rb +111 -0
  11. data/app/controllers/tasker/page_sort.rb +97 -0
  12. data/app/controllers/tasker/task_diagrams_controller.rb +30 -0
  13. data/app/controllers/tasker/tasks_controller.rb +123 -0
  14. data/app/controllers/tasker/workflow_steps_controller.rb +69 -0
  15. data/app/graphql/examples/all_tasks.graphql +22 -0
  16. data/app/graphql/examples/pending_tasks.graphql +23 -0
  17. data/app/graphql/tasker/graph_ql_types/annotation_type.rb +14 -0
  18. data/app/graphql/tasker/graph_ql_types/base_argument.rb +9 -0
  19. data/app/graphql/tasker/graph_ql_types/base_connection.rb +11 -0
  20. data/app/graphql/tasker/graph_ql_types/base_edge.rb +10 -0
  21. data/app/graphql/tasker/graph_ql_types/base_enum.rb +9 -0
  22. data/app/graphql/tasker/graph_ql_types/base_field.rb +10 -0
  23. data/app/graphql/tasker/graph_ql_types/base_input_object.rb +10 -0
  24. data/app/graphql/tasker/graph_ql_types/base_interface.rb +14 -0
  25. data/app/graphql/tasker/graph_ql_types/base_object.rb +10 -0
  26. data/app/graphql/tasker/graph_ql_types/base_scalar.rb +9 -0
  27. data/app/graphql/tasker/graph_ql_types/base_union.rb +11 -0
  28. data/app/graphql/tasker/graph_ql_types/dependent_system_object_map_type.rb +18 -0
  29. data/app/graphql/tasker/graph_ql_types/dependent_system_type.rb +13 -0
  30. data/app/graphql/tasker/graph_ql_types/mutation_type.rb +16 -0
  31. data/app/graphql/tasker/graph_ql_types/named_step_type.rb +16 -0
  32. data/app/graphql/tasker/graph_ql_types/named_task_type.rb +14 -0
  33. data/app/graphql/tasker/graph_ql_types/named_tasks_named_step_type.rb +19 -0
  34. data/app/graphql/tasker/graph_ql_types/node_type.rb +12 -0
  35. data/app/graphql/tasker/graph_ql_types/query_type.rb +20 -0
  36. data/app/graphql/tasker/graph_ql_types/task_annotation_type.rb +17 -0
  37. data/app/graphql/tasker/graph_ql_types/task_interface.rb +17 -0
  38. data/app/graphql/tasker/graph_ql_types/task_type.rb +26 -0
  39. data/app/graphql/tasker/graph_ql_types/workflow_step_type.rb +154 -0
  40. data/app/graphql/tasker/graph_ql_types.rb +42 -0
  41. data/app/graphql/tasker/mutations/base_mutation.rb +13 -0
  42. data/app/graphql/tasker/mutations/cancel_step.rb +29 -0
  43. data/app/graphql/tasker/mutations/cancel_task.rb +29 -0
  44. data/app/graphql/tasker/mutations/create_task.rb +52 -0
  45. data/app/graphql/tasker/mutations/update_step.rb +36 -0
  46. data/app/graphql/tasker/mutations/update_task.rb +41 -0
  47. data/app/graphql/tasker/queries/all_annotation_types.rb +17 -0
  48. data/app/graphql/tasker/queries/all_tasks.rb +23 -0
  49. data/app/graphql/tasker/queries/base_query.rb +9 -0
  50. data/app/graphql/tasker/queries/helpers.rb +16 -0
  51. data/app/graphql/tasker/queries/one_step.rb +24 -0
  52. data/app/graphql/tasker/queries/one_task.rb +18 -0
  53. data/app/graphql/tasker/queries/tasks_by_annotation.rb +31 -0
  54. data/app/graphql/tasker/queries/tasks_by_status.rb +30 -0
  55. data/app/graphql/tasker/tasker_rails_schema.rb +52 -0
  56. data/app/jobs/tasker/application_job.rb +8 -0
  57. data/app/jobs/tasker/metrics_export_job.rb +252 -0
  58. data/app/jobs/tasker/task_runner_job.rb +224 -0
  59. data/app/models/tasker/annotation_type.rb +26 -0
  60. data/app/models/tasker/application_record.rb +70 -0
  61. data/app/models/tasker/dependent_system.rb +26 -0
  62. data/app/models/tasker/dependent_system_object_map.rb +64 -0
  63. data/app/models/tasker/diagram/edge.rb +106 -0
  64. data/app/models/tasker/diagram/flowchart.rb +137 -0
  65. data/app/models/tasker/diagram/node.rb +99 -0
  66. data/app/models/tasker/named_step.rb +41 -0
  67. data/app/models/tasker/named_task.rb +121 -0
  68. data/app/models/tasker/named_tasks_named_step.rb +82 -0
  69. data/app/models/tasker/step_dag_relationship.rb +65 -0
  70. data/app/models/tasker/step_readiness_status.rb +59 -0
  71. data/app/models/tasker/task.rb +424 -0
  72. data/app/models/tasker/task_annotation.rb +36 -0
  73. data/app/models/tasker/task_diagram.rb +332 -0
  74. data/app/models/tasker/task_execution_context.rb +29 -0
  75. data/app/models/tasker/task_namespace.rb +41 -0
  76. data/app/models/tasker/task_transition.rb +235 -0
  77. data/app/models/tasker/workflow_step.rb +461 -0
  78. data/app/models/tasker/workflow_step_edge.rb +94 -0
  79. data/app/models/tasker/workflow_step_transition.rb +434 -0
  80. data/app/serializers/tasker/annotation_type_serializer.rb +8 -0
  81. data/app/serializers/tasker/handler_serializer.rb +109 -0
  82. data/app/serializers/tasker/task_annotation_serializer.rb +32 -0
  83. data/app/serializers/tasker/task_serializer.rb +168 -0
  84. data/app/serializers/tasker/workflow_step_serializer.rb +27 -0
  85. data/app/services/tasker/analytics_service.rb +409 -0
  86. data/app/views/tasker/task/_diagram.html.erb +32 -0
  87. data/config/initializers/dry_struct.rb +11 -0
  88. data/config/initializers/statesman.rb +6 -0
  89. data/config/initializers/tasker_orchestration.rb +17 -0
  90. data/config/initializers/time_formats.rb +4 -0
  91. data/config/routes.rb +34 -0
  92. data/config/tasker/subscriptions/example_integrations.yml +67 -0
  93. data/config/tasker/system_events.yml +305 -0
  94. data/db/functions/calculate_dependency_levels_v01.sql +45 -0
  95. data/db/functions/get_analytics_metrics_v01.sql +137 -0
  96. data/db/functions/get_slowest_steps_v01.sql +82 -0
  97. data/db/functions/get_slowest_tasks_v01.sql +96 -0
  98. data/db/functions/get_step_readiness_status_batch_v01.sql +140 -0
  99. data/db/functions/get_step_readiness_status_v01.sql +139 -0
  100. data/db/functions/get_system_health_counts_v01.sql +108 -0
  101. data/db/functions/get_task_execution_context_v01.sql +108 -0
  102. data/db/functions/get_task_execution_contexts_batch_v01.sql +104 -0
  103. data/db/init/schema.sql +2277 -0
  104. data/db/migrate/20250701165431_initial_tasker_schema.rb +116 -0
  105. data/db/views/tasker_step_dag_relationships_v01.sql +69 -0
  106. data/docs/APPLICATION_GENERATOR.md +384 -0
  107. data/docs/AUTH.md +1780 -0
  108. data/docs/CIRCUIT_BREAKER.md +224 -0
  109. data/docs/DEVELOPER_GUIDE.md +2665 -0
  110. data/docs/EVENT_SYSTEM.md +637 -0
  111. data/docs/EXECUTION_CONFIGURATION.md +341 -0
  112. data/docs/FLOW_CHART.md +149 -0
  113. data/docs/HEALTH.md +542 -0
  114. data/docs/METRICS.md +731 -0
  115. data/docs/OPTIMIZATION_PLAN.md +1479 -0
  116. data/docs/OVERVIEW.md +552 -0
  117. data/docs/QUICK_START.md +270 -0
  118. data/docs/REGISTRY_SYSTEMS.md +373 -0
  119. data/docs/REST_API.md +632 -0
  120. data/docs/ROADMAP.md +221 -0
  121. data/docs/SQL_FUNCTIONS.md +1408 -0
  122. data/docs/TASK_DIAGRAM.md +252 -0
  123. data/docs/TASK_EXECUTION_CONTROL_FLOW.md +237 -0
  124. data/docs/TELEMETRY.md +795 -0
  125. data/docs/TROUBLESHOOTING.md +756 -0
  126. data/docs/TaskHandlerGenerator.html +255 -0
  127. data/docs/Tasker/Analysis/RuntimeGraphAnalyzer.html +907 -0
  128. data/docs/Tasker/Analysis/TemplateGraphAnalyzer.html +1236 -0
  129. data/docs/Tasker/Analysis.html +117 -0
  130. data/docs/Tasker/AnalyticsController.html +450 -0
  131. data/docs/Tasker/AnalyticsService/BottleneckAnalytics.html +816 -0
  132. data/docs/Tasker/AnalyticsService/PerformanceAnalytics.html +586 -0
  133. data/docs/Tasker/AnalyticsService.html +2221 -0
  134. data/docs/Tasker/AnnotationType.html +137 -0
  135. data/docs/Tasker/AnnotationTypeSerializer.html +124 -0
  136. data/docs/Tasker/ApplicationController.html +147 -0
  137. data/docs/Tasker/ApplicationJob.html +128 -0
  138. data/docs/Tasker/ApplicationRecord.html +378 -0
  139. data/docs/Tasker/Authentication/AuthenticationError.html +124 -0
  140. data/docs/Tasker/Authentication/ConfigurationError.html +124 -0
  141. data/docs/Tasker/Authentication/Coordinator.html +242 -0
  142. data/docs/Tasker/Authentication/Interface.html +560 -0
  143. data/docs/Tasker/Authentication/InterfaceError.html +124 -0
  144. data/docs/Tasker/Authentication/NoneAuthenticator.html +338 -0
  145. data/docs/Tasker/Authentication.html +119 -0
  146. data/docs/Tasker/Authorization/AuthorizationError.html +139 -0
  147. data/docs/Tasker/Authorization/BaseCoordinator.html +927 -0
  148. data/docs/Tasker/Authorization/ConfigurationError.html +153 -0
  149. data/docs/Tasker/Authorization/ResourceConstants/ACTIONS.html +428 -0
  150. data/docs/Tasker/Authorization/ResourceConstants/RESOURCES.html +365 -0
  151. data/docs/Tasker/Authorization/ResourceConstants.html +146 -0
  152. data/docs/Tasker/Authorization/ResourceRegistry.html +882 -0
  153. data/docs/Tasker/Authorization/UnauthorizedError.html +153 -0
  154. data/docs/Tasker/Authorization.html +582 -0
  155. data/docs/Tasker/CacheCapabilities.html +167 -0
  156. data/docs/Tasker/CacheStrategy.html +1297 -0
  157. data/docs/Tasker/Concerns/Authenticatable.html +116 -0
  158. data/docs/Tasker/Concerns/Authorizable/AdminStatusChecker.html +256 -0
  159. data/docs/Tasker/Concerns/Authorizable.html +816 -0
  160. data/docs/Tasker/Concerns/ControllerAuthorizable.html +157 -0
  161. data/docs/Tasker/Concerns/EventPublisher.html +4023 -0
  162. data/docs/Tasker/Concerns/IdempotentStateTransitions.html +806 -0
  163. data/docs/Tasker/Concerns/LifecycleEventHelpers.html +129 -0
  164. data/docs/Tasker/Concerns/OrchestrationPublisher.html +129 -0
  165. data/docs/Tasker/Concerns/StateMachineBase/ClassMethods.html +1075 -0
  166. data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase/ClassMethods.html +191 -0
  167. data/docs/Tasker/Concerns/StateMachineBase/StateMachineBase.html +126 -0
  168. data/docs/Tasker/Concerns/StateMachineBase.html +153 -0
  169. data/docs/Tasker/Concerns/StructuredLogging.html +1413 -0
  170. data/docs/Tasker/Concerns.html +117 -0
  171. data/docs/Tasker/Configuration/AuthConfiguration.html +1023 -0
  172. data/docs/Tasker/Configuration/ConfigurationProxy.html +581 -0
  173. data/docs/Tasker/Configuration/DatabaseConfiguration.html +475 -0
  174. data/docs/Tasker/Configuration/EngineConfiguration.html +1265 -0
  175. data/docs/Tasker/Configuration/HealthConfiguration.html +791 -0
  176. data/docs/Tasker/Configuration/TelemetryConfiguration.html +1308 -0
  177. data/docs/Tasker/Configuration/TelemetryConfigurationProxy.html +388 -0
  178. data/docs/Tasker/Configuration.html +1669 -0
  179. data/docs/Tasker/ConfigurationError.html +143 -0
  180. data/docs/Tasker/ConfiguredTask.html +514 -0
  181. data/docs/Tasker/Constants/EventDefinitions.html +590 -0
  182. data/docs/Tasker/Constants/LifecycleEvents.html +137 -0
  183. data/docs/Tasker/Constants/ObservabilityEvents/Step.html +152 -0
  184. data/docs/Tasker/Constants/ObservabilityEvents/Task.html +142 -0
  185. data/docs/Tasker/Constants/ObservabilityEvents.html +126 -0
  186. data/docs/Tasker/Constants/RegistryEvents.html +285 -0
  187. data/docs/Tasker/Constants/StepEvents.html +177 -0
  188. data/docs/Tasker/Constants/TaskEvents.html +167 -0
  189. data/docs/Tasker/Constants/TaskExecution/ExecutionStatus.html +207 -0
  190. data/docs/Tasker/Constants/TaskExecution/HealthStatus.html +191 -0
  191. data/docs/Tasker/Constants/TaskExecution/RecommendedAction.html +207 -0
  192. data/docs/Tasker/Constants/TaskExecution.html +126 -0
  193. data/docs/Tasker/Constants/TaskFinalization/ErrorMessages.html +132 -0
  194. data/docs/Tasker/Constants/TaskFinalization/PendingReasons.html +207 -0
  195. data/docs/Tasker/Constants/TaskFinalization/ReenqueueReasons.html +239 -0
  196. data/docs/Tasker/Constants/TaskFinalization.html +126 -0
  197. data/docs/Tasker/Constants/TaskStatuses.html +223 -0
  198. data/docs/Tasker/Constants/TestEvents.html +163 -0
  199. data/docs/Tasker/Constants/WorkflowEvents.html +222 -0
  200. data/docs/Tasker/Constants/WorkflowStepStatuses.html +223 -0
  201. data/docs/Tasker/Constants.html +561 -0
  202. data/docs/Tasker/DependentSystem.html +137 -0
  203. data/docs/Tasker/DependentSystemObjectMap.html +250 -0
  204. data/docs/Tasker/DetectorRegistry.html +598 -0
  205. data/docs/Tasker/Diagram/Edge.html +1191 -0
  206. data/docs/Tasker/Diagram/Flowchart.html +1539 -0
  207. data/docs/Tasker/Diagram/Node.html +1165 -0
  208. data/docs/Tasker/Diagram.html +117 -0
  209. data/docs/Tasker/Engine.html +215 -0
  210. data/docs/Tasker/Error.html +139 -0
  211. data/docs/Tasker/Events/Bus.html +1226 -0
  212. data/docs/Tasker/Events/Catalog/CatalogPrinter.html +258 -0
  213. data/docs/Tasker/Events/Catalog/CustomEventRegistrar.html +276 -0
  214. data/docs/Tasker/Events/Catalog/ExamplePayloadGenerator.html +294 -0
  215. data/docs/Tasker/Events/Catalog.html +1291 -0
  216. data/docs/Tasker/Events/CustomRegistry.html +943 -0
  217. data/docs/Tasker/Events/DefinitionLoader.html +575 -0
  218. data/docs/Tasker/Events/EventPayloadBuilder/ErrorInfoExtractor.html +286 -0
  219. data/docs/Tasker/Events/EventPayloadBuilder/StepPayloadBuilder.html +312 -0
  220. data/docs/Tasker/Events/EventPayloadBuilder.html +664 -0
  221. data/docs/Tasker/Events/Publisher.html +365 -0
  222. data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer/ErrorTypeClassifier.html +1128 -0
  223. data/docs/Tasker/Events/Subscribers/BaseSubscriber/ErrorCategorizer.html +270 -0
  224. data/docs/Tasker/Events/Subscribers/BaseSubscriber/MetricTagsExtractor.html +266 -0
  225. data/docs/Tasker/Events/Subscribers/BaseSubscriber.html +2556 -0
  226. data/docs/Tasker/Events/Subscribers/MetricsSubscriber.html +723 -0
  227. data/docs/Tasker/Events/Subscribers/TelemetrySubscriber.html +2251 -0
  228. data/docs/Tasker/Events/Subscribers.html +117 -0
  229. data/docs/Tasker/Events/SubscriptionLoader.html +493 -0
  230. data/docs/Tasker/Events.html +294 -0
  231. data/docs/Tasker/EventsGenerator.html +459 -0
  232. data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics/AnalyticsMetrics.html +135 -0
  233. data/docs/Tasker/Functions/FunctionBasedAnalyticsMetrics.html +412 -0
  234. data/docs/Tasker/Functions/FunctionBasedDependencyLevels.html +598 -0
  235. data/docs/Tasker/Functions/FunctionBasedSlowestSteps/SlowestStep.html +135 -0
  236. data/docs/Tasker/Functions/FunctionBasedSlowestSteps.html +453 -0
  237. data/docs/Tasker/Functions/FunctionBasedSlowestTasks/SlowestTask.html +135 -0
  238. data/docs/Tasker/Functions/FunctionBasedSlowestTasks.html +453 -0
  239. data/docs/Tasker/Functions/FunctionBasedStepReadinessStatus.html +1457 -0
  240. data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts/HealthMetrics.html +135 -0
  241. data/docs/Tasker/Functions/FunctionBasedSystemHealthCounts.html +370 -0
  242. data/docs/Tasker/Functions/FunctionBasedTaskExecutionContext.html +1250 -0
  243. data/docs/Tasker/Functions/FunctionWrapper.html +479 -0
  244. data/docs/Tasker/Functions.html +117 -0
  245. data/docs/Tasker/Generators/AuthenticatorGenerator/UsageInstructionsFormatter.html +244 -0
  246. data/docs/Tasker/Generators/AuthenticatorGenerator.html +373 -0
  247. data/docs/Tasker/Generators/AuthorizationCoordinatorGenerator.html +430 -0
  248. data/docs/Tasker/Generators/SubscriberGenerator.html +377 -0
  249. data/docs/Tasker/Generators/TaskHandlerGenerator.html +263 -0
  250. data/docs/Tasker/Generators.html +117 -0
  251. data/docs/Tasker/GraphQLTypes/AnnotationType.html +132 -0
  252. data/docs/Tasker/GraphQLTypes/BaseArgument.html +124 -0
  253. data/docs/Tasker/GraphQLTypes/BaseConnection.html +124 -0
  254. data/docs/Tasker/GraphQLTypes/BaseEdge.html +130 -0
  255. data/docs/Tasker/GraphQLTypes/BaseEnum.html +124 -0
  256. data/docs/Tasker/GraphQLTypes/BaseField.html +124 -0
  257. data/docs/Tasker/GraphQLTypes/BaseInputObject.html +124 -0
  258. data/docs/Tasker/GraphQLTypes/BaseInterface.html +116 -0
  259. data/docs/Tasker/GraphQLTypes/BaseObject.html +128 -0
  260. data/docs/Tasker/GraphQLTypes/BaseScalar.html +124 -0
  261. data/docs/Tasker/GraphQLTypes/BaseUnion.html +124 -0
  262. data/docs/Tasker/GraphQLTypes/DependentSystemObjectMapType.html +132 -0
  263. data/docs/Tasker/GraphQLTypes/DependentSystemType.html +132 -0
  264. data/docs/Tasker/GraphQLTypes/MutationType.html +132 -0
  265. data/docs/Tasker/GraphQLTypes/NamedStepType.html +132 -0
  266. data/docs/Tasker/GraphQLTypes/NamedTaskType.html +132 -0
  267. data/docs/Tasker/GraphQLTypes/NamedTasksNamedStepType.html +132 -0
  268. data/docs/Tasker/GraphQLTypes/NodeType.html +118 -0
  269. data/docs/Tasker/GraphQLTypes/QueryType.html +139 -0
  270. data/docs/Tasker/GraphQLTypes/TaskAnnotationType.html +132 -0
  271. data/docs/Tasker/GraphQLTypes/TaskInterface.html +111 -0
  272. data/docs/Tasker/GraphQLTypes/TaskType.html +201 -0
  273. data/docs/Tasker/GraphQLTypes/WorkflowStepType.html +694 -0
  274. data/docs/Tasker/GraphQLTypes.html +130 -0
  275. data/docs/Tasker/GraphqlController.html +251 -0
  276. data/docs/Tasker/HandlerFactory.html +1518 -0
  277. data/docs/Tasker/HandlerSerializer.html +682 -0
  278. data/docs/Tasker/HandlersController.html +574 -0
  279. data/docs/Tasker/HashIdentityStrategy.html +278 -0
  280. data/docs/Tasker/Health/ReadinessChecker.html +712 -0
  281. data/docs/Tasker/Health/StatusChecker.html +653 -0
  282. data/docs/Tasker/Health.html +117 -0
  283. data/docs/Tasker/HealthController.html +523 -0
  284. data/docs/Tasker/IdentityStrategy.html +276 -0
  285. data/docs/Tasker/InvalidTaskHandlerConfig.html +135 -0
  286. data/docs/Tasker/LifecycleEvents/Events/Step.html +162 -0
  287. data/docs/Tasker/LifecycleEvents/Events/Task.html +162 -0
  288. data/docs/Tasker/LifecycleEvents/Events.html +204 -0
  289. data/docs/Tasker/LifecycleEvents/Publisher.html +132 -0
  290. data/docs/Tasker/LifecycleEvents.html +799 -0
  291. data/docs/Tasker/Logging/CorrelationIdGenerator.html +688 -0
  292. data/docs/Tasker/Logging.html +115 -0
  293. data/docs/Tasker/MetricsController.html +293 -0
  294. data/docs/Tasker/MetricsExportJob.html +414 -0
  295. data/docs/Tasker/Mutations/BaseMutation.html +128 -0
  296. data/docs/Tasker/Mutations/CancelStep.html +219 -0
  297. data/docs/Tasker/Mutations/CancelTask.html +221 -0
  298. data/docs/Tasker/Mutations/CreateTask.html +243 -0
  299. data/docs/Tasker/Mutations/UpdateStep.html +243 -0
  300. data/docs/Tasker/Mutations/UpdateTask.html +243 -0
  301. data/docs/Tasker/Mutations.html +117 -0
  302. data/docs/Tasker/NamedStep.html +216 -0
  303. data/docs/Tasker/NamedTask.html +910 -0
  304. data/docs/Tasker/NamedTasksNamedStep.html +435 -0
  305. data/docs/Tasker/Orchestration/BackoffCalculator.html +404 -0
  306. data/docs/Tasker/Orchestration/ConnectionBuilder/ConfigValidator.html +258 -0
  307. data/docs/Tasker/Orchestration/ConnectionBuilder.html +435 -0
  308. data/docs/Tasker/Orchestration/ConnectionPoolIntelligence.html +513 -0
  309. data/docs/Tasker/Orchestration/Coordinator.html +641 -0
  310. data/docs/Tasker/Orchestration/FutureStateAnalyzer.html +1045 -0
  311. data/docs/Tasker/Orchestration/Orchestrator.html +679 -0
  312. data/docs/Tasker/Orchestration/PluginIntegration.html +1127 -0
  313. data/docs/Tasker/Orchestration/ResponseProcessor.html +504 -0
  314. data/docs/Tasker/Orchestration/RetryHeaderParser.html +304 -0
  315. data/docs/Tasker/Orchestration/StepExecutor.html +995 -0
  316. data/docs/Tasker/Orchestration/StepSequenceFactory.html +644 -0
  317. data/docs/Tasker/Orchestration/TaskFinalizer/BlockageChecker.html +264 -0
  318. data/docs/Tasker/Orchestration/TaskFinalizer/ContextManager.html +254 -0
  319. data/docs/Tasker/Orchestration/TaskFinalizer/DelayCalculator.html +556 -0
  320. data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationDecisionMaker.html +348 -0
  321. data/docs/Tasker/Orchestration/TaskFinalizer/FinalizationProcessor.html +286 -0
  322. data/docs/Tasker/Orchestration/TaskFinalizer/ReasonDeterminer.html +432 -0
  323. data/docs/Tasker/Orchestration/TaskFinalizer/ReenqueueManager.html +296 -0
  324. data/docs/Tasker/Orchestration/TaskFinalizer/UnclearStateHandler.html +314 -0
  325. data/docs/Tasker/Orchestration/TaskFinalizer.html +1212 -0
  326. data/docs/Tasker/Orchestration/TaskInitializer.html +766 -0
  327. data/docs/Tasker/Orchestration/TaskReenqueuer.html +506 -0
  328. data/docs/Tasker/Orchestration/ViableStepDiscovery.html +442 -0
  329. data/docs/Tasker/Orchestration/WorkflowCoordinator.html +510 -0
  330. data/docs/Tasker/Orchestration.html +130 -0
  331. data/docs/Tasker/PageSort/PageSortParamsBuilder.html +296 -0
  332. data/docs/Tasker/PageSort.html +247 -0
  333. data/docs/Tasker/PermanentError.html +518 -0
  334. data/docs/Tasker/ProceduralError.html +147 -0
  335. data/docs/Tasker/Queries/AllAnnotationTypes.html +217 -0
  336. data/docs/Tasker/Queries/AllTasks.html +221 -0
  337. data/docs/Tasker/Queries/BaseQuery.html +128 -0
  338. data/docs/Tasker/Queries/Helpers.html +187 -0
  339. data/docs/Tasker/Queries/OneStep.html +225 -0
  340. data/docs/Tasker/Queries/OneTask.html +217 -0
  341. data/docs/Tasker/Queries/TasksByAnnotation.html +231 -0
  342. data/docs/Tasker/Queries/TasksByStatus.html +233 -0
  343. data/docs/Tasker/Queries.html +119 -0
  344. data/docs/Tasker/Railtie.html +124 -0
  345. data/docs/Tasker/Registry/BaseRegistry.html +1690 -0
  346. data/docs/Tasker/Registry/EventPublisher.html +667 -0
  347. data/docs/Tasker/Registry/InterfaceValidator.html +569 -0
  348. data/docs/Tasker/Registry/RegistrationError.html +132 -0
  349. data/docs/Tasker/Registry/RegistryError.html +139 -0
  350. data/docs/Tasker/Registry/StatisticsCollector.html +841 -0
  351. data/docs/Tasker/Registry/SubscriberRegistry.html +1504 -0
  352. data/docs/Tasker/Registry/ValidationError.html +132 -0
  353. data/docs/Tasker/Registry.html +119 -0
  354. data/docs/Tasker/RetryableError.html +515 -0
  355. data/docs/Tasker/StateMachine/Compatibility.html +282 -0
  356. data/docs/Tasker/StateMachine/InvalidStateTransition.html +135 -0
  357. data/docs/Tasker/StateMachine/StepStateMachine/StandardizedPayloadBuilder.html +260 -0
  358. data/docs/Tasker/StateMachine/StepStateMachine.html +2215 -0
  359. data/docs/Tasker/StateMachine/TaskStateMachine.html +734 -0
  360. data/docs/Tasker/StateMachine.html +602 -0
  361. data/docs/Tasker/StepDagRelationship.html +657 -0
  362. data/docs/Tasker/StepHandler/Api/Config.html +1091 -0
  363. data/docs/Tasker/StepHandler/Api.html +884 -0
  364. data/docs/Tasker/StepHandler/AutomaticEventPublishing.html +321 -0
  365. data/docs/Tasker/StepHandler/Base.html +970 -0
  366. data/docs/Tasker/StepHandler.html +119 -0
  367. data/docs/Tasker/StepReadinessStatus.html +836 -0
  368. data/docs/Tasker/Task.html +2575 -0
  369. data/docs/Tasker/TaskAnnotation.html +137 -0
  370. data/docs/Tasker/TaskAnnotationSerializer.html +124 -0
  371. data/docs/Tasker/TaskBuilder/StepNameValidator.html +264 -0
  372. data/docs/Tasker/TaskBuilder/StepTemplateDefiner.html +264 -0
  373. data/docs/Tasker/TaskBuilder.html +764 -0
  374. data/docs/Tasker/TaskDiagram/StepToStepEdgeBuilder.html +260 -0
  375. data/docs/Tasker/TaskDiagram/TaskToRootStepEdgeBuilder.html +290 -0
  376. data/docs/Tasker/TaskDiagram.html +548 -0
  377. data/docs/Tasker/TaskDiagramsController.html +240 -0
  378. data/docs/Tasker/TaskExecutionContext.html +469 -0
  379. data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/ClassBasedEventRegistrar.html +238 -0
  380. data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner/YamlEventRegistrar.html +254 -0
  381. data/docs/Tasker/TaskHandler/ClassMethods/StepTemplateDefiner.html +988 -0
  382. data/docs/Tasker/TaskHandler/ClassMethods.html +357 -0
  383. data/docs/Tasker/TaskHandler/InstanceMethods.html +1396 -0
  384. data/docs/Tasker/TaskHandler/StepGroup.html +1748 -0
  385. data/docs/Tasker/TaskHandler.html +271 -0
  386. data/docs/Tasker/TaskNamespace.html +312 -0
  387. data/docs/Tasker/TaskRunnerJob.html +406 -0
  388. data/docs/Tasker/TaskSerializer.html +474 -0
  389. data/docs/Tasker/TaskTransition.html +1517 -0
  390. data/docs/Tasker/TaskWorkflowSummary.html +988 -0
  391. data/docs/Tasker/TaskerRailsSchema/InvalidObjectTypeError.html +132 -0
  392. data/docs/Tasker/TaskerRailsSchema/TypeResolutionError.html +139 -0
  393. data/docs/Tasker/TaskerRailsSchema/UnknownInterfaceError.html +132 -0
  394. data/docs/Tasker/TaskerRailsSchema.html +384 -0
  395. data/docs/Tasker/TasksController.html +595 -0
  396. data/docs/Tasker/Telemetry/EventMapping.html +1307 -0
  397. data/docs/Tasker/Telemetry/EventRouter.html +2178 -0
  398. data/docs/Tasker/Telemetry/Events/ExportEvents.html +246 -0
  399. data/docs/Tasker/Telemetry/Events.html +115 -0
  400. data/docs/Tasker/Telemetry/ExportCoordinator/DistributedLockTimeoutError.html +135 -0
  401. data/docs/Tasker/Telemetry/ExportCoordinator.html +2137 -0
  402. data/docs/Tasker/Telemetry/IntelligentCacheManager.html +1083 -0
  403. data/docs/Tasker/Telemetry/LogBackend.html +1088 -0
  404. data/docs/Tasker/Telemetry/MetricTypes/Counter.html +1054 -0
  405. data/docs/Tasker/Telemetry/MetricTypes/Gauge.html +1270 -0
  406. data/docs/Tasker/Telemetry/MetricTypes/Histogram.html +1492 -0
  407. data/docs/Tasker/Telemetry/MetricTypes.html +153 -0
  408. data/docs/Tasker/Telemetry/MetricsBackend.html +2510 -0
  409. data/docs/Tasker/Telemetry/MetricsExportService.html +578 -0
  410. data/docs/Tasker/Telemetry/PluginRegistry.html +1774 -0
  411. data/docs/Tasker/Telemetry/Plugins/BaseExporter.html +1835 -0
  412. data/docs/Tasker/Telemetry/Plugins/CsvExporter.html +768 -0
  413. data/docs/Tasker/Telemetry/Plugins/JsonExporter.html +747 -0
  414. data/docs/Tasker/Telemetry/Plugins.html +117 -0
  415. data/docs/Tasker/Telemetry/PrometheusExporter.html +481 -0
  416. data/docs/Tasker/Telemetry/TraceBackend.html +891 -0
  417. data/docs/Tasker/Telemetry.html +130 -0
  418. data/docs/Tasker/Types/AuthConfig.html +886 -0
  419. data/docs/Tasker/Types/BackoffConfig.html +1063 -0
  420. data/docs/Tasker/Types/BaseConfig.html +227 -0
  421. data/docs/Tasker/Types/CacheConfig.html +1731 -0
  422. data/docs/Tasker/Types/DatabaseConfig.html +388 -0
  423. data/docs/Tasker/Types/DependencyGraph.html +526 -0
  424. data/docs/Tasker/Types/DependencyGraphConfig.html +753 -0
  425. data/docs/Tasker/Types/EngineConfig.html +1181 -0
  426. data/docs/Tasker/Types/ExecutionConfig.html +1963 -0
  427. data/docs/Tasker/Types/GraphEdge.html +517 -0
  428. data/docs/Tasker/Types/GraphMetadata.html +781 -0
  429. data/docs/Tasker/Types/GraphNode.html +694 -0
  430. data/docs/Tasker/Types/HealthConfig.html +784 -0
  431. data/docs/Tasker/Types/StepSequence.html +353 -0
  432. data/docs/Tasker/Types/StepTemplate.html +1193 -0
  433. data/docs/Tasker/Types/TaskRequest.html +1179 -0
  434. data/docs/Tasker/Types/TelemetryConfig.html +2746 -0
  435. data/docs/Tasker/Types.html +154 -0
  436. data/docs/Tasker/WorkflowStep/StepFinder.html +282 -0
  437. data/docs/Tasker/WorkflowStep.html +2724 -0
  438. data/docs/Tasker/WorkflowStepEdge.html +304 -0
  439. data/docs/Tasker/WorkflowStepSerializer.html +305 -0
  440. data/docs/Tasker/WorkflowStepTransition/TransitionDescriptionFormatter.html +282 -0
  441. data/docs/Tasker/WorkflowStepTransition.html +2201 -0
  442. data/docs/Tasker/WorkflowStepsController.html +462 -0
  443. data/docs/Tasker.html +452 -0
  444. data/docs/VISION.md +584 -0
  445. data/docs/WHY.md +21 -0
  446. data/docs/_index.html +2375 -0
  447. data/docs/class_list.html +54 -0
  448. data/docs/css/common.css +1 -0
  449. data/docs/css/full_list.css +58 -0
  450. data/docs/css/style.css +503 -0
  451. data/docs/events/migration_plan_outcomes.md +80 -0
  452. data/docs/file.README.html +541 -0
  453. data/docs/file_list.html +59 -0
  454. data/docs/frames.html +22 -0
  455. data/docs/index.html +541 -0
  456. data/docs/js/app.js +344 -0
  457. data/docs/js/full_list.js +242 -0
  458. data/docs/js/jquery.js +4 -0
  459. data/docs/method_list.html +9182 -0
  460. data/docs/top-level-namespace.html +110 -0
  461. data/lib/generators/tasker/authenticator_generator.rb +301 -0
  462. data/lib/generators/tasker/authorization_coordinator_generator.rb +139 -0
  463. data/lib/generators/tasker/events_generator.rb +91 -0
  464. data/lib/generators/tasker/subscriber_generator.rb +107 -0
  465. data/lib/generators/tasker/task_handler_generator.rb +138 -0
  466. data/lib/generators/tasker/templates/api_token_authenticator.rb.erb +113 -0
  467. data/lib/generators/tasker/templates/api_token_authenticator_spec.rb.erb +144 -0
  468. data/lib/generators/tasker/templates/authorization_coordinator.rb.erb +95 -0
  469. data/lib/generators/tasker/templates/authorization_coordinator_spec.rb.erb +142 -0
  470. data/lib/generators/tasker/templates/custom_authenticator.rb.erb +108 -0
  471. data/lib/generators/tasker/templates/custom_authenticator_spec.rb.erb +162 -0
  472. data/lib/generators/tasker/templates/custom_events.yml.erb +62 -0
  473. data/lib/generators/tasker/templates/custom_subscriber.rb.erb +72 -0
  474. data/lib/generators/tasker/templates/devise_authenticator.rb.erb +101 -0
  475. data/lib/generators/tasker/templates/devise_authenticator_spec.rb.erb +126 -0
  476. data/lib/generators/tasker/templates/initialize.rb.erb +202 -0
  477. data/lib/generators/tasker/templates/jwt_authenticator.rb.erb +144 -0
  478. data/lib/generators/tasker/templates/jwt_authenticator_spec.rb.erb +298 -0
  479. data/lib/generators/tasker/templates/metrics_subscriber.rb.erb +258 -0
  480. data/lib/generators/tasker/templates/metrics_subscriber_spec.rb.erb +308 -0
  481. data/lib/generators/tasker/templates/omniauth_authenticator.rb.erb +135 -0
  482. data/lib/generators/tasker/templates/omniauth_authenticator_spec.rb.erb +196 -0
  483. data/lib/generators/tasker/templates/opentelemetry_initializer.rb +52 -0
  484. data/lib/generators/tasker/templates/subscriber.rb.erb +64 -0
  485. data/lib/generators/tasker/templates/subscriber_spec.rb.erb +80 -0
  486. data/lib/generators/tasker/templates/task_config.yaml.erb +117 -0
  487. data/lib/generators/tasker/templates/task_handler.rb.erb +59 -0
  488. data/lib/generators/tasker/templates/task_handler_spec.rb.erb +159 -0
  489. data/lib/tasker/analysis/runtime_graph_analyzer.rb +1168 -0
  490. data/lib/tasker/analysis/template_graph_analyzer.rb +328 -0
  491. data/lib/tasker/authentication/coordinator.rb +78 -0
  492. data/lib/tasker/authentication/errors.rb +9 -0
  493. data/lib/tasker/authentication/interface.rb +36 -0
  494. data/lib/tasker/authentication/none_authenticator.rb +26 -0
  495. data/lib/tasker/authorization/base_coordinator.rb +112 -0
  496. data/lib/tasker/authorization/errors.rb +26 -0
  497. data/lib/tasker/authorization/resource_constants.rb +74 -0
  498. data/lib/tasker/authorization/resource_registry.rb +143 -0
  499. data/lib/tasker/authorization.rb +75 -0
  500. data/lib/tasker/cache_capabilities.rb +131 -0
  501. data/lib/tasker/cache_strategy.rb +469 -0
  502. data/lib/tasker/concerns/authenticatable.rb +41 -0
  503. data/lib/tasker/concerns/authorizable.rb +204 -0
  504. data/lib/tasker/concerns/controller_authorizable.rb +124 -0
  505. data/lib/tasker/concerns/event_publisher.rb +716 -0
  506. data/lib/tasker/concerns/idempotent_state_transitions.rb +128 -0
  507. data/lib/tasker/concerns/state_machine_base.rb +218 -0
  508. data/lib/tasker/concerns/structured_logging.rb +387 -0
  509. data/lib/tasker/configuration.rb +325 -0
  510. data/lib/tasker/constants/event_definitions.rb +147 -0
  511. data/lib/tasker/constants/registry_events.rb +54 -0
  512. data/lib/tasker/constants.rb +417 -0
  513. data/lib/tasker/engine.rb +90 -0
  514. data/lib/tasker/errors.rb +90 -0
  515. data/lib/tasker/events/catalog.rb +432 -0
  516. data/lib/tasker/events/custom_registry.rb +175 -0
  517. data/lib/tasker/events/definition_loader.rb +199 -0
  518. data/lib/tasker/events/event_payload_builder.rb +461 -0
  519. data/lib/tasker/events/publisher.rb +149 -0
  520. data/lib/tasker/events/subscribers/base_subscriber.rb +601 -0
  521. data/lib/tasker/events/subscribers/metrics_subscriber.rb +120 -0
  522. data/lib/tasker/events/subscribers/telemetry_subscriber.rb +462 -0
  523. data/lib/tasker/events/subscription_loader.rb +161 -0
  524. data/lib/tasker/events.rb +37 -0
  525. data/lib/tasker/functions/function_based_analytics_metrics.rb +103 -0
  526. data/lib/tasker/functions/function_based_dependency_levels.rb +54 -0
  527. data/lib/tasker/functions/function_based_slowest_steps.rb +84 -0
  528. data/lib/tasker/functions/function_based_slowest_tasks.rb +84 -0
  529. data/lib/tasker/functions/function_based_step_readiness_status.rb +183 -0
  530. data/lib/tasker/functions/function_based_system_health_counts.rb +94 -0
  531. data/lib/tasker/functions/function_based_task_execution_context.rb +148 -0
  532. data/lib/tasker/functions/function_wrapper.rb +42 -0
  533. data/lib/tasker/functions.rb +12 -0
  534. data/lib/tasker/handler_factory.rb +322 -0
  535. data/lib/tasker/health/readiness_checker.rb +186 -0
  536. data/lib/tasker/health/status_checker.rb +203 -0
  537. data/lib/tasker/identity_strategy.rb +38 -0
  538. data/lib/tasker/logging/correlation_id_generator.rb +120 -0
  539. data/lib/tasker/orchestration/backoff_calculator.rb +184 -0
  540. data/lib/tasker/orchestration/connection_builder.rb +122 -0
  541. data/lib/tasker/orchestration/connection_pool_intelligence.rb +177 -0
  542. data/lib/tasker/orchestration/coordinator.rb +119 -0
  543. data/lib/tasker/orchestration/future_state_analyzer.rb +137 -0
  544. data/lib/tasker/orchestration/plugin_integration.rb +124 -0
  545. data/lib/tasker/orchestration/response_processor.rb +168 -0
  546. data/lib/tasker/orchestration/retry_header_parser.rb +78 -0
  547. data/lib/tasker/orchestration/step_executor.rb +941 -0
  548. data/lib/tasker/orchestration/step_sequence_factory.rb +67 -0
  549. data/lib/tasker/orchestration/task_finalizer.rb +564 -0
  550. data/lib/tasker/orchestration/task_initializer.rb +140 -0
  551. data/lib/tasker/orchestration/task_reenqueuer.rb +71 -0
  552. data/lib/tasker/orchestration/viable_step_discovery.rb +65 -0
  553. data/lib/tasker/orchestration/workflow_coordinator.rb +294 -0
  554. data/lib/tasker/orchestration.rb +45 -0
  555. data/lib/tasker/railtie.rb +9 -0
  556. data/lib/tasker/registry/base_registry.rb +177 -0
  557. data/lib/tasker/registry/event_publisher.rb +91 -0
  558. data/lib/tasker/registry/interface_validator.rb +140 -0
  559. data/lib/tasker/registry/statistics_collector.rb +381 -0
  560. data/lib/tasker/registry/subscriber_registry.rb +285 -0
  561. data/lib/tasker/registry.rb +22 -0
  562. data/lib/tasker/state_machine/step_state_machine.rb +508 -0
  563. data/lib/tasker/state_machine/task_state_machine.rb +192 -0
  564. data/lib/tasker/state_machine.rb +83 -0
  565. data/lib/tasker/step_handler/api.rb +410 -0
  566. data/lib/tasker/step_handler/base.rb +206 -0
  567. data/lib/tasker/task_builder.rb +432 -0
  568. data/lib/tasker/task_handler/class_methods.rb +324 -0
  569. data/lib/tasker/task_handler/instance_methods.rb +293 -0
  570. data/lib/tasker/task_handler/step_group.rb +182 -0
  571. data/lib/tasker/task_handler.rb +43 -0
  572. data/lib/tasker/telemetry/event_mapping.rb +126 -0
  573. data/lib/tasker/telemetry/event_router.rb +318 -0
  574. data/lib/tasker/telemetry/events/export_events.rb +38 -0
  575. data/lib/tasker/telemetry/export_coordinator.rb +497 -0
  576. data/lib/tasker/telemetry/intelligent_cache_manager.rb +508 -0
  577. data/lib/tasker/telemetry/log_backend.rb +224 -0
  578. data/lib/tasker/telemetry/metric_types.rb +368 -0
  579. data/lib/tasker/telemetry/metrics_backend.rb +1227 -0
  580. data/lib/tasker/telemetry/metrics_export_service.rb +392 -0
  581. data/lib/tasker/telemetry/plugin_registry.rb +333 -0
  582. data/lib/tasker/telemetry/plugins/base_exporter.rb +246 -0
  583. data/lib/tasker/telemetry/plugins/csv_exporter.rb +198 -0
  584. data/lib/tasker/telemetry/plugins/json_exporter.rb +141 -0
  585. data/lib/tasker/telemetry/prometheus_exporter.rb +249 -0
  586. data/lib/tasker/telemetry/trace_backend.rb +186 -0
  587. data/lib/tasker/telemetry.rb +59 -0
  588. data/lib/tasker/types/auth_config.rb +81 -0
  589. data/lib/tasker/types/backoff_config.rb +142 -0
  590. data/lib/tasker/types/cache_config.rb +257 -0
  591. data/lib/tasker/types/database_config.rb +39 -0
  592. data/lib/tasker/types/dependency_graph.rb +225 -0
  593. data/lib/tasker/types/dependency_graph_config.rb +149 -0
  594. data/lib/tasker/types/engine_config.rb +131 -0
  595. data/lib/tasker/types/execution_config.rb +289 -0
  596. data/lib/tasker/types/health_config.rb +84 -0
  597. data/lib/tasker/types/step_sequence.rb +24 -0
  598. data/lib/tasker/types/step_template.rb +63 -0
  599. data/lib/tasker/types/task_request.rb +60 -0
  600. data/lib/tasker/types/telemetry_config.rb +273 -0
  601. data/lib/tasker/types.rb +64 -0
  602. data/lib/tasker/version.rb +7 -0
  603. data/lib/tasker.rb +82 -0
  604. data/lib/tasks/tasker_tasks.rake +302 -0
  605. metadata +958 -0
@@ -0,0 +1,1413 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: Tasker::Concerns::StructuredLogging
8
+
9
+ &mdash; Documentation by YARD 0.9.37
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Tasker::Concerns::StructuredLogging";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (S)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Tasker.html" title="Tasker (module)">Tasker</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Concerns.html" title="Tasker::Concerns (module)">Concerns</a></span></span>
41
+ &raquo;
42
+ <span class="title">StructuredLogging</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: Tasker::Concerns::StructuredLogging
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+ <dl>
73
+ <dt>Extended by:</dt>
74
+ <dd>ActiveSupport::Concern</dd>
75
+ </dl>
76
+
77
+
78
+
79
+
80
+
81
+
82
+ <dl>
83
+ <dt>Included in:</dt>
84
+ <dd><span class='object_link'><a href="../CacheStrategy.html" title="Tasker::CacheStrategy (class)">Tasker::CacheStrategy</a></span>, <span class='object_link'><a href="../MetricsExportJob.html" title="Tasker::MetricsExportJob (class)">MetricsExportJob</a></span>, <span class='object_link'><a href="../Orchestration/StepExecutor.html" title="Tasker::Orchestration::StepExecutor (class)">Orchestration::StepExecutor</a></span>, <span class='object_link'><a href="../Orchestration/WorkflowCoordinator.html" title="Tasker::Orchestration::WorkflowCoordinator (class)">Orchestration::WorkflowCoordinator</a></span>, <span class='object_link'><a href="../Registry/BaseRegistry.html" title="Tasker::Registry::BaseRegistry (class)">Registry::BaseRegistry</a></span>, <span class='object_link'><a href="../Registry/StatisticsCollector.html" title="Tasker::Registry::StatisticsCollector (class)">Registry::StatisticsCollector</a></span>, <span class='object_link'><a href="../StepHandler/Base.html" title="Tasker::StepHandler::Base (class)">StepHandler::Base</a></span>, <span class='object_link'><a href="../TaskRunnerJob.html" title="Tasker::TaskRunnerJob (class)">TaskRunnerJob</a></span>, <span class='object_link'><a href="../Telemetry/ExportCoordinator.html" title="Tasker::Telemetry::ExportCoordinator (class)">Telemetry::ExportCoordinator</a></span>, <span class='object_link'><a href="../Telemetry/IntelligentCacheManager.html" title="Tasker::Telemetry::IntelligentCacheManager (class)">Telemetry::IntelligentCacheManager</a></span>, <span class='object_link'><a href="../Telemetry/MetricsExportService.html" title="Tasker::Telemetry::MetricsExportService (class)">Telemetry::MetricsExportService</a></span>, <span class='object_link'><a href="../Telemetry/Plugins/BaseExporter.html" title="Tasker::Telemetry::Plugins::BaseExporter (class)">Telemetry::Plugins::BaseExporter</a></span></dd>
85
+ </dl>
86
+
87
+
88
+
89
+ <dl>
90
+ <dt>Defined in:</dt>
91
+ <dd>lib/tasker/concerns/structured_logging.rb</dd>
92
+ </dl>
93
+
94
+ </div>
95
+
96
+ <h2>Overview</h2><div class="docstring">
97
+ <div class="discussion">
98
+
99
+ <p>StructuredLogging provides correlation ID tracking and consistent JSON formatting</p>
100
+
101
+ <p>This concern builds on Tasker’s existing event system to add production-grade structured logging with correlation IDs for distributed tracing across workflows.</p>
102
+
103
+ <p>Key Features: - Automatic correlation ID generation and propagation - JSON structured logging with consistent format - Integration with existing telemetry configuration - Parameter filtering for sensitive data - Performance-optimized with minimal overhead</p>
104
+
105
+ <p>Usage: include Tasker::Concerns::StructuredLogging</p>
106
+
107
+ <p># Basic structured logging log_structured(:info, “Task started”, task_id: task.task_id)</p>
108
+
109
+ <p># Domain-specific helpers log_task_event(task, :started, execution_mode: ‘async’) log_step_event(step, :completed, duration: 1.5)</p>
110
+
111
+ <p># Correlation ID propagation with_correlation_id(request_id) do # All logging within this block includes the correlation ID log_structured(:info, “Processing workflow”) end</p>
112
+
113
+
114
+ </div>
115
+ </div>
116
+ <div class="tags">
117
+
118
+
119
+ </div>
120
+
121
+ <h2>
122
+ Constant Summary
123
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
124
+ </h2>
125
+
126
+ <dl class="constants">
127
+
128
+ <dt id="CORRELATION_ID_KEY-constant" class="">CORRELATION_ID_KEY =
129
+ <div class="docstring">
130
+ <div class="discussion">
131
+
132
+ <p>Thread-local storage for correlation ID to ensure thread safety</p>
133
+
134
+
135
+ </div>
136
+ </div>
137
+ <div class="tags">
138
+
139
+
140
+ </div>
141
+ </dt>
142
+ <dd><pre class="code"><span class='symbol'>:tasker_correlation_id</span></pre></dd>
143
+
144
+ </dl>
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <h2>
155
+ Instance Method Summary
156
+ <small><a href="#" class="summary_toggle">collapse</a></small>
157
+ </h2>
158
+
159
+ <ul class="summary">
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#correlation_id-instance_method" title="#correlation_id (instance method)">#<strong>correlation_id</strong> &#x21d2; String </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'>
179
+ <p>Get the current correlation ID, generating one if needed.</p>
180
+ </div></span>
181
+
182
+ </li>
183
+
184
+
185
+ <li class="public ">
186
+ <span class="summary_signature">
187
+
188
+ <a href="#correlation_id=-instance_method" title="#correlation_id= (instance method)">#<strong>correlation_id=</strong>(id) &#x21d2; String </a>
189
+
190
+
191
+
192
+ </span>
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+ <span class="summary_desc"><div class='inline'>
203
+ <p>Set a specific correlation ID for the current execution context.</p>
204
+ </div></span>
205
+
206
+ </li>
207
+
208
+
209
+ <li class="public ">
210
+ <span class="summary_signature">
211
+
212
+ <a href="#log_exception-instance_method" title="#log_exception (instance method)">#<strong>log_exception</strong>(exception, context: {}, level: :error) &#x21d2; void </a>
213
+
214
+
215
+
216
+ </span>
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+ <span class="summary_desc"><div class='inline'>
227
+ <p>Log exceptions with full context and structured format.</p>
228
+ </div></span>
229
+
230
+ </li>
231
+
232
+
233
+ <li class="public ">
234
+ <span class="summary_signature">
235
+
236
+ <a href="#log_orchestration_event-instance_method" title="#log_orchestration_event (instance method)">#<strong>log_orchestration_event</strong>(operation, event_type, **context) &#x21d2; void </a>
237
+
238
+
239
+
240
+ </span>
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+ <span class="summary_desc"><div class='inline'>
251
+ <p>Log orchestration events (workflow coordination, reenqueuing, etc.).</p>
252
+ </div></span>
253
+
254
+ </li>
255
+
256
+
257
+ <li class="public ">
258
+ <span class="summary_signature">
259
+
260
+ <a href="#log_performance_event-instance_method" title="#log_performance_event (instance method)">#<strong>log_performance_event</strong>(operation, duration, **context) &#x21d2; void </a>
261
+
262
+
263
+
264
+ </span>
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+ <span class="summary_desc"><div class='inline'>
275
+ <p>Log performance-related events with timing and resource usage.</p>
276
+ </div></span>
277
+
278
+ </li>
279
+
280
+
281
+ <li class="public ">
282
+ <span class="summary_signature">
283
+
284
+ <a href="#log_step_event-instance_method" title="#log_step_event (instance method)">#<strong>log_step_event</strong>(step, event_type, duration: nil, **context) &#x21d2; void </a>
285
+
286
+
287
+
288
+ </span>
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+
297
+
298
+ <span class="summary_desc"><div class='inline'>
299
+ <p>Log step-related events with standardized format.</p>
300
+ </div></span>
301
+
302
+ </li>
303
+
304
+
305
+ <li class="public ">
306
+ <span class="summary_signature">
307
+
308
+ <a href="#log_structured-instance_method" title="#log_structured (instance method)">#<strong>log_structured</strong>(level, message, **context) &#x21d2; void </a>
309
+
310
+
311
+
312
+ </span>
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+ <span class="summary_desc"><div class='inline'>
323
+ <p>Log with structured JSON format including correlation ID and context.</p>
324
+ </div></span>
325
+
326
+ </li>
327
+
328
+
329
+ <li class="public ">
330
+ <span class="summary_signature">
331
+
332
+ <a href="#log_task_event-instance_method" title="#log_task_event (instance method)">#<strong>log_task_event</strong>(task, event_type, **context) &#x21d2; void </a>
333
+
334
+
335
+
336
+ </span>
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
346
+ <span class="summary_desc"><div class='inline'>
347
+ <p>Log task-related events with standardized format.</p>
348
+ </div></span>
349
+
350
+ </li>
351
+
352
+
353
+ <li class="public ">
354
+ <span class="summary_signature">
355
+
356
+ <a href="#with_correlation_id-instance_method" title="#with_correlation_id (instance method)">#<strong>with_correlation_id</strong>(id) { ... } &#x21d2; Object </a>
357
+
358
+
359
+
360
+ </span>
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+ <span class="summary_desc"><div class='inline'>
371
+ <p>Execute a block with a specific correlation ID.</p>
372
+ </div></span>
373
+
374
+ </li>
375
+
376
+
377
+ </ul>
378
+
379
+
380
+
381
+
382
+
383
+ <div id="instance_method_details" class="method_details_list">
384
+ <h2>Instance Method Details</h2>
385
+
386
+
387
+ <div class="method_details first">
388
+ <h3 class="signature first" id="correlation_id-instance_method">
389
+
390
+ #<strong>correlation_id</strong> &#x21d2; <tt>String</tt>
391
+
392
+
393
+
394
+
395
+
396
+ </h3><div class="docstring">
397
+ <div class="discussion">
398
+
399
+ <p>Get the current correlation ID, generating one if needed</p>
400
+
401
+
402
+ </div>
403
+ </div>
404
+ <div class="tags">
405
+
406
+ <p class="tag_title">Returns:</p>
407
+ <ul class="return">
408
+
409
+ <li>
410
+
411
+
412
+ <span class='type'>(<tt>String</tt>)</span>
413
+
414
+
415
+
416
+ &mdash;
417
+ <div class='inline'>
418
+ <p>The correlation ID for the current execution context</p>
419
+ </div>
420
+
421
+ </li>
422
+
423
+ </ul>
424
+
425
+ </div><table class="source_code">
426
+ <tr>
427
+ <td>
428
+ <pre class="lines">
429
+
430
+
431
+ 83
432
+ 84
433
+ 85</pre>
434
+ </td>
435
+ <td>
436
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 83</span>
437
+
438
+ <span class='kw'>def</span> <span class='id identifier rubyid_correlation_id'>correlation_id</span>
439
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#CORRELATION_ID_KEY-constant" title="Tasker::Concerns::StructuredLogging::CORRELATION_ID_KEY (constant)">CORRELATION_ID_KEY</a></span></span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_generate_correlation_id'>generate_correlation_id</span>
440
+ <span class='kw'>end</span></pre>
441
+ </td>
442
+ </tr>
443
+ </table>
444
+ </div>
445
+
446
+ <div class="method_details ">
447
+ <h3 class="signature " id="correlation_id=-instance_method">
448
+
449
+ #<strong>correlation_id=</strong>(id) &#x21d2; <tt>String</tt>
450
+
451
+
452
+
453
+
454
+
455
+ </h3><div class="docstring">
456
+ <div class="discussion">
457
+
458
+ <p>Set a specific correlation ID for the current execution context</p>
459
+
460
+
461
+ </div>
462
+ </div>
463
+ <div class="tags">
464
+ <p class="tag_title">Parameters:</p>
465
+ <ul class="param">
466
+
467
+ <li>
468
+
469
+ <span class='name'>id</span>
470
+
471
+
472
+ <span class='type'>(<tt>String</tt>)</span>
473
+
474
+
475
+
476
+ &mdash;
477
+ <div class='inline'>
478
+ <p>The correlation ID to use</p>
479
+ </div>
480
+
481
+ </li>
482
+
483
+ </ul>
484
+
485
+ <p class="tag_title">Returns:</p>
486
+ <ul class="return">
487
+
488
+ <li>
489
+
490
+
491
+ <span class='type'>(<tt>String</tt>)</span>
492
+
493
+
494
+
495
+ &mdash;
496
+ <div class='inline'>
497
+ <p>The correlation ID that was set</p>
498
+ </div>
499
+
500
+ </li>
501
+
502
+ </ul>
503
+
504
+ </div><table class="source_code">
505
+ <tr>
506
+ <td>
507
+ <pre class="lines">
508
+
509
+
510
+ 91
511
+ 92
512
+ 93</pre>
513
+ </td>
514
+ <td>
515
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 91</span>
516
+
517
+ <span class='kw'>def</span> <span class='id identifier rubyid_correlation_id='>correlation_id=</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
518
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#CORRELATION_ID_KEY-constant" title="Tasker::Concerns::StructuredLogging::CORRELATION_ID_KEY (constant)">CORRELATION_ID_KEY</a></span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
519
+ <span class='kw'>end</span></pre>
520
+ </td>
521
+ </tr>
522
+ </table>
523
+ </div>
524
+
525
+ <div class="method_details ">
526
+ <h3 class="signature " id="log_exception-instance_method">
527
+
528
+ #<strong>log_exception</strong>(exception, context: {}, level: :error) &#x21d2; <tt>void</tt>
529
+
530
+
531
+
532
+
533
+
534
+ </h3><div class="docstring">
535
+ <div class="discussion">
536
+ <p class="note returns_void">This method returns an undefined value.</p>
537
+ <p>Log exceptions with full context and structured format</p>
538
+
539
+
540
+ </div>
541
+ </div>
542
+ <div class="tags">
543
+
544
+ <div class="examples">
545
+ <h4 class="tag_title">Examples:</h4>
546
+
547
+
548
+ <pre class="example code"><code><span class='id identifier rubyid_log_exception'>log_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='label'>operation:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>step_execution</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>step_id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>step_123</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
549
+ <span class='id identifier rubyid_log_exception'>log_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='comma'>,</span> <span class='label'>operation:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>task_finalization</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>task_id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>task_456</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>level:</span> <span class='symbol'>:fatal</span><span class='rparen'>)</span></code></pre>
550
+
551
+ </div>
552
+ <p class="tag_title">Parameters:</p>
553
+ <ul class="param">
554
+
555
+ <li>
556
+
557
+ <span class='name'>exception</span>
558
+
559
+
560
+ <span class='type'>(<tt>Exception</tt>)</span>
561
+
562
+
563
+
564
+ &mdash;
565
+ <div class='inline'>
566
+ <p>The exception to log</p>
567
+ </div>
568
+
569
+ </li>
570
+
571
+ <li>
572
+
573
+ <span class='name'>context</span>
574
+
575
+
576
+ <span class='type'>(<tt>Hash</tt>)</span>
577
+
578
+
579
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
580
+
581
+
582
+ &mdash;
583
+ <div class='inline'>
584
+ <p>Additional context about when/where the exception occurred</p>
585
+ </div>
586
+
587
+ </li>
588
+
589
+ <li>
590
+
591
+ <span class='name'>level</span>
592
+
593
+
594
+ <span class='type'>(<tt>Symbol</tt>)</span>
595
+
596
+
597
+ <em class="default">(defaults to: <tt>:error</tt>)</em>
598
+
599
+
600
+ &mdash;
601
+ <div class='inline'>
602
+ <p>Log level (defaults to :error)</p>
603
+ </div>
604
+
605
+ </li>
606
+
607
+ </ul>
608
+
609
+
610
+ </div><table class="source_code">
611
+ <tr>
612
+ <td>
613
+ <pre class="lines">
614
+
615
+
616
+ 229
617
+ 230
618
+ 231
619
+ 232
620
+ 233
621
+ 234
622
+ 235
623
+ 236
624
+ 237
625
+ 238
626
+ 239</pre>
627
+ </td>
628
+ <td>
629
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 229</span>
630
+
631
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_exception'>log_exception</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='comma'>,</span> <span class='label'>context:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>level:</span> <span class='symbol'>:error</span><span class='rparen'>)</span>
632
+ <span class='id identifier rubyid_exception_context'>exception_context</span> <span class='op'>=</span> <span class='lbrace'>{</span>
633
+ <span class='label'>entity_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>exception</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
634
+ <span class='label'>exception_class:</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
635
+ <span class='label'>exception_message:</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span>
636
+ <span class='label'>backtrace:</span> <span class='id identifier rubyid_extract_relevant_backtrace'>extract_relevant_backtrace</span><span class='lparen'>(</span><span class='id identifier rubyid_exception'>exception</span><span class='rparen'>)</span><span class='comma'>,</span>
637
+ <span class='op'>**</span><span class='id identifier rubyid_context'>context</span>
638
+ <span class='rbrace'>}</span>
639
+
640
+ <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Exception occurred: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_exception_context'>exception_context</span><span class='rparen'>)</span>
641
+ <span class='kw'>end</span></pre>
642
+ </td>
643
+ </tr>
644
+ </table>
645
+ </div>
646
+
647
+ <div class="method_details ">
648
+ <h3 class="signature " id="log_orchestration_event-instance_method">
649
+
650
+ #<strong>log_orchestration_event</strong>(operation, event_type, **context) &#x21d2; <tt>void</tt>
651
+
652
+
653
+
654
+
655
+
656
+ </h3><div class="docstring">
657
+ <div class="discussion">
658
+ <p class="note returns_void">This method returns an undefined value.</p>
659
+ <p>Log orchestration events (workflow coordination, reenqueuing, etc.)</p>
660
+
661
+
662
+ </div>
663
+ </div>
664
+ <div class="tags">
665
+
666
+ <div class="examples">
667
+ <h4 class="tag_title">Examples:</h4>
668
+
669
+
670
+ <pre class="example code"><code><span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>workflow_coordination</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='label'>task_id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>task_123</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
671
+ <span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>step_execution_batch</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span>
672
+ <span class='label'>step_count:</span> <span class='int'>3</span><span class='comma'>,</span> <span class='label'>total_duration:</span> <span class='float'>5.2</span><span class='rparen'>)</span></code></pre>
673
+
674
+ </div>
675
+ <p class="tag_title">Parameters:</p>
676
+ <ul class="param">
677
+
678
+ <li>
679
+
680
+ <span class='name'>operation</span>
681
+
682
+
683
+ <span class='type'>(<tt>String</tt>)</span>
684
+
685
+
686
+
687
+ &mdash;
688
+ <div class='inline'>
689
+ <p>The orchestration operation name</p>
690
+ </div>
691
+
692
+ </li>
693
+
694
+ <li>
695
+
696
+ <span class='name'>event_type</span>
697
+
698
+
699
+ <span class='type'>(<tt>Symbol</tt>)</span>
700
+
701
+
702
+
703
+ &mdash;
704
+ <div class='inline'>
705
+ <p>The type of event (:started, :completed, :failed, etc.)</p>
706
+ </div>
707
+
708
+ </li>
709
+
710
+ <li>
711
+
712
+ <span class='name'>context</span>
713
+
714
+
715
+ <span class='type'>(<tt>Hash</tt>)</span>
716
+
717
+
718
+
719
+ &mdash;
720
+ <div class='inline'>
721
+ <p>Additional context to include in the log</p>
722
+ </div>
723
+
724
+ </li>
725
+
726
+ </ul>
727
+
728
+
729
+ </div><table class="source_code">
730
+ <tr>
731
+ <td>
732
+ <pre class="lines">
733
+
734
+
735
+ 182
736
+ 183
737
+ 184
738
+ 185
739
+ 186
740
+ 187
741
+ 188</pre>
742
+ </td>
743
+ <td>
744
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 182</span>
745
+
746
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_orchestration_event'>log_orchestration_event</span><span class='lparen'>(</span><span class='id identifier rubyid_operation'>operation</span><span class='comma'>,</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
747
+ <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:debug</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Orchestration </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_type'>event_type</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
748
+ <span class='label'>entity_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>orchestration</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
749
+ <span class='label'>operation:</span> <span class='id identifier rubyid_operation'>operation</span><span class='comma'>,</span>
750
+ <span class='label'>event_type:</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span>
751
+ <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
752
+ <span class='kw'>end</span></pre>
753
+ </td>
754
+ </tr>
755
+ </table>
756
+ </div>
757
+
758
+ <div class="method_details ">
759
+ <h3 class="signature " id="log_performance_event-instance_method">
760
+
761
+ #<strong>log_performance_event</strong>(operation, duration, **context) &#x21d2; <tt>void</tt>
762
+
763
+
764
+
765
+
766
+
767
+ </h3><div class="docstring">
768
+ <div class="discussion">
769
+ <p class="note returns_void">This method returns an undefined value.</p>
770
+ <p>Log performance-related events with timing and resource usage</p>
771
+
772
+
773
+ </div>
774
+ </div>
775
+ <div class="tags">
776
+
777
+ <div class="examples">
778
+ <h4 class="tag_title">Examples:</h4>
779
+
780
+
781
+ <pre class="example code"><code><span class='id identifier rubyid_log_performance_event'>log_performance_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>dependency_graph_analysis</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='float'>0.85</span><span class='comma'>,</span>
782
+ <span class='label'>node_count:</span> <span class='int'>25</span><span class='comma'>,</span> <span class='label'>complexity:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>medium</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
783
+ <span class='id identifier rubyid_log_performance_event'>log_performance_event</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>sql_query</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='float'>2.1</span><span class='comma'>,</span>
784
+ <span class='label'>query_type:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>select</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='label'>table:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>workflow_steps</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></code></pre>
785
+
786
+ </div>
787
+ <p class="tag_title">Parameters:</p>
788
+ <ul class="param">
789
+
790
+ <li>
791
+
792
+ <span class='name'>operation</span>
793
+
794
+
795
+ <span class='type'>(<tt>String</tt>)</span>
796
+
797
+
798
+
799
+ &mdash;
800
+ <div class='inline'>
801
+ <p>The operation being measured</p>
802
+ </div>
803
+
804
+ </li>
805
+
806
+ <li>
807
+
808
+ <span class='name'>duration</span>
809
+
810
+
811
+ <span class='type'>(<tt>Float</tt>)</span>
812
+
813
+
814
+
815
+ &mdash;
816
+ <div class='inline'>
817
+ <p>Duration in seconds</p>
818
+ </div>
819
+
820
+ </li>
821
+
822
+ <li>
823
+
824
+ <span class='name'>context</span>
825
+
826
+
827
+ <span class='type'>(<tt>Hash</tt>)</span>
828
+
829
+
830
+
831
+ &mdash;
832
+ <div class='inline'>
833
+ <p>Additional performance context</p>
834
+ </div>
835
+
836
+ </li>
837
+
838
+ </ul>
839
+
840
+
841
+ </div><table class="source_code">
842
+ <tr>
843
+ <td>
844
+ <pre class="lines">
845
+
846
+
847
+ 202
848
+ 203
849
+ 204
850
+ 205
851
+ 206
852
+ 207
853
+ 208
854
+ 209
855
+ 210
856
+ 211
857
+ 212
858
+ 213</pre>
859
+ </td>
860
+ <td>
861
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 202</span>
862
+
863
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_performance_event'>log_performance_event</span><span class='lparen'>(</span><span class='id identifier rubyid_operation'>operation</span><span class='comma'>,</span> <span class='id identifier rubyid_duration'>duration</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
864
+ <span class='id identifier rubyid_performance_context'>performance_context</span> <span class='op'>=</span> <span class='lbrace'>{</span>
865
+ <span class='label'>entity_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>performance</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
866
+ <span class='label'>operation:</span> <span class='id identifier rubyid_operation'>operation</span><span class='comma'>,</span>
867
+ <span class='label'>duration_ms:</span> <span class='lparen'>(</span><span class='id identifier rubyid_duration'>duration</span> <span class='op'>*</span> <span class='int'>1000</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span><span class='comma'>,</span>
868
+ <span class='label'>performance_category:</span> <span class='id identifier rubyid_categorize_duration'>categorize_duration</span><span class='lparen'>(</span><span class='id identifier rubyid_duration'>duration</span><span class='rparen'>)</span><span class='comma'>,</span>
869
+ <span class='label'>is_slow:</span> <span class='id identifier rubyid_duration'>duration</span> <span class='op'>&gt;</span> <span class='id identifier rubyid_telemetry_config'>telemetry_config</span><span class='period'>.</span><span class='id identifier rubyid_slow_query_threshold_seconds'>slow_query_threshold_seconds</span>
870
+ <span class='rbrace'>}</span>
871
+
872
+ <span class='id identifier rubyid_level'>level</span> <span class='op'>=</span> <span class='id identifier rubyid_performance_context'>performance_context</span><span class='lbracket'>[</span><span class='symbol'>:is_slow</span><span class='rbracket'>]</span> <span class='op'>?</span> <span class='symbol'>:warn</span> <span class='op'>:</span> <span class='symbol'>:debug</span>
873
+ <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>Performance measurement</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_performance_context'>performance_context</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
874
+ <span class='kw'>end</span></pre>
875
+ </td>
876
+ </tr>
877
+ </table>
878
+ </div>
879
+
880
+ <div class="method_details ">
881
+ <h3 class="signature " id="log_step_event-instance_method">
882
+
883
+ #<strong>log_step_event</strong>(step, event_type, duration: nil, **context) &#x21d2; <tt>void</tt>
884
+
885
+
886
+
887
+
888
+
889
+ </h3><div class="docstring">
890
+ <div class="discussion">
891
+ <p class="note returns_void">This method returns an undefined value.</p>
892
+ <p>Log step-related events with standardized format</p>
893
+
894
+
895
+ </div>
896
+ </div>
897
+ <div class="tags">
898
+
899
+ <div class="examples">
900
+ <h4 class="tag_title">Examples:</h4>
901
+
902
+
903
+ <pre class="example code"><code><span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='rparen'>)</span>
904
+ <span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='float'>2.5</span><span class='comma'>,</span> <span class='label'>records_processed:</span> <span class='int'>150</span><span class='rparen'>)</span>
905
+ <span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='float'>1.2</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Connection timeout</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span></code></pre>
906
+
907
+ </div>
908
+ <p class="tag_title">Parameters:</p>
909
+ <ul class="param">
910
+
911
+ <li>
912
+
913
+ <span class='name'>step</span>
914
+
915
+
916
+ <span class='type'>(<tt><span class='object_link'><a href="../WorkflowStep.html" title="Tasker::WorkflowStep (class)">Tasker::WorkflowStep</a></span></tt>)</span>
917
+
918
+
919
+
920
+ &mdash;
921
+ <div class='inline'>
922
+ <p>The step object</p>
923
+ </div>
924
+
925
+ </li>
926
+
927
+ <li>
928
+
929
+ <span class='name'>event_type</span>
930
+
931
+
932
+ <span class='type'>(<tt>Symbol</tt>)</span>
933
+
934
+
935
+
936
+ &mdash;
937
+ <div class='inline'>
938
+ <p>The type of event (:started, :completed, :failed, etc.)</p>
939
+ </div>
940
+
941
+ </li>
942
+
943
+ <li>
944
+
945
+ <span class='name'>duration</span>
946
+
947
+
948
+ <span class='type'>(<tt>Float</tt>, <tt>nil</tt>)</span>
949
+
950
+
951
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
952
+
953
+
954
+ &mdash;
955
+ <div class='inline'>
956
+ <p>Execution duration in seconds</p>
957
+ </div>
958
+
959
+ </li>
960
+
961
+ <li>
962
+
963
+ <span class='name'>context</span>
964
+
965
+
966
+ <span class='type'>(<tt>Hash</tt>)</span>
967
+
968
+
969
+
970
+ &mdash;
971
+ <div class='inline'>
972
+ <p>Additional context to include in the log</p>
973
+ </div>
974
+
975
+ </li>
976
+
977
+ </ul>
978
+
979
+
980
+ </div><table class="source_code">
981
+ <tr>
982
+ <td>
983
+ <pre class="lines">
984
+
985
+
986
+ 151
987
+ 152
988
+ 153
989
+ 154
990
+ 155
991
+ 156
992
+ 157
993
+ 158
994
+ 159
995
+ 160
996
+ 161
997
+ 162
998
+ 163
999
+ 164
1000
+ 165
1001
+ 166
1002
+ 167
1003
+ 168
1004
+ 169</pre>
1005
+ </td>
1006
+ <td>
1007
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 151</span>
1008
+
1009
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_step_event'>log_step_event</span><span class='lparen'>(</span><span class='id identifier rubyid_step'>step</span><span class='comma'>,</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1010
+ <span class='id identifier rubyid_step_context'>step_context</span> <span class='op'>=</span> <span class='lbrace'>{</span>
1011
+ <span class='label'>entity_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>step</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
1012
+ <span class='label'>entity_id:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_workflow_step_id'>workflow_step_id</span><span class='comma'>,</span>
1013
+ <span class='label'>entity_name:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
1014
+ <span class='label'>event_type:</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span>
1015
+ <span class='label'>step_status:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
1016
+ <span class='label'>task_id:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
1017
+ <span class='label'>task_name:</span> <span class='id identifier rubyid_step'>step</span><span class='period'>.</span><span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span>
1018
+ <span class='rbrace'>}</span>
1019
+
1020
+ <span class='comment'># Add performance data if provided
1021
+ </span> <span class='kw'>if</span> <span class='id identifier rubyid_duration'>duration</span>
1022
+ <span class='id identifier rubyid_step_context'>step_context</span><span class='lbracket'>[</span><span class='symbol'>:duration_ms</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_duration'>duration</span> <span class='op'>*</span> <span class='int'>1000</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_round'>round</span><span class='lparen'>(</span><span class='int'>2</span><span class='rparen'>)</span>
1023
+ <span class='id identifier rubyid_step_context'>step_context</span><span class='lbracket'>[</span><span class='symbol'>:performance_category</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_categorize_duration'>categorize_duration</span><span class='lparen'>(</span><span class='id identifier rubyid_duration'>duration</span><span class='rparen'>)</span>
1024
+ <span class='kw'>end</span>
1025
+
1026
+ <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Step </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_type'>event_type</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_step_context'>step_context</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1027
+ <span class='kw'>end</span></pre>
1028
+ </td>
1029
+ </tr>
1030
+ </table>
1031
+ </div>
1032
+
1033
+ <div class="method_details ">
1034
+ <h3 class="signature " id="log_structured-instance_method">
1035
+
1036
+ #<strong>log_structured</strong>(level, message, **context) &#x21d2; <tt>void</tt>
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+ </h3><div class="docstring">
1043
+ <div class="discussion">
1044
+ <p class="note returns_void">This method returns an undefined value.</p>
1045
+ <p>Log with structured JSON format including correlation ID and context</p>
1046
+
1047
+
1048
+ </div>
1049
+ </div>
1050
+ <div class="tags">
1051
+
1052
+ <div class="examples">
1053
+ <h4 class="tag_title">Examples:</h4>
1054
+
1055
+
1056
+ <h5 class="example_title"><div class='inline'>
1057
+ <p>Basic usage</p>
1058
+ </div></h5>
1059
+
1060
+ <pre class="example code"><code><span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Task execution started</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1061
+ <span class='label'>task_id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>task_123</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1062
+ <span class='label'>task_name:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>order_processing</span><span class='tstring_end'>&quot;</span></span>
1063
+ <span class='rparen'>)</span></code></pre>
1064
+
1065
+
1066
+ <h5 class="example_title"><div class='inline'>
1067
+ <p>With performance data</p>
1068
+ </div></h5>
1069
+
1070
+ <pre class="example code"><code><span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:debug</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Step completed successfully</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1071
+ <span class='label'>step_id:</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>step_456</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1072
+ <span class='label'>duration_ms:</span> <span class='float'>250.5</span><span class='comma'>,</span>
1073
+ <span class='label'>memory_delta_mb:</span> <span class='float'>12.3</span>
1074
+ <span class='rparen'>)</span></code></pre>
1075
+
1076
+ </div>
1077
+ <p class="tag_title">Parameters:</p>
1078
+ <ul class="param">
1079
+
1080
+ <li>
1081
+
1082
+ <span class='name'>level</span>
1083
+
1084
+
1085
+ <span class='type'>(<tt>Symbol</tt>)</span>
1086
+
1087
+
1088
+
1089
+ &mdash;
1090
+ <div class='inline'>
1091
+ <p>Log level (:debug, :info, :warn, :error, :fatal)</p>
1092
+ </div>
1093
+
1094
+ </li>
1095
+
1096
+ <li>
1097
+
1098
+ <span class='name'>message</span>
1099
+
1100
+
1101
+ <span class='type'>(<tt>String</tt>)</span>
1102
+
1103
+
1104
+
1105
+ &mdash;
1106
+ <div class='inline'>
1107
+ <p>Human-readable log message</p>
1108
+ </div>
1109
+
1110
+ </li>
1111
+
1112
+ <li>
1113
+
1114
+ <span class='name'>context</span>
1115
+
1116
+
1117
+ <span class='type'>(<tt>Hash</tt>)</span>
1118
+
1119
+
1120
+
1121
+ &mdash;
1122
+ <div class='inline'>
1123
+ <p>Additional structured context data</p>
1124
+ </div>
1125
+
1126
+ </li>
1127
+
1128
+ </ul>
1129
+
1130
+
1131
+ </div><table class="source_code">
1132
+ <tr>
1133
+ <td>
1134
+ <pre class="lines">
1135
+
1136
+
1137
+ 63
1138
+ 64
1139
+ 65
1140
+ 66
1141
+ 67
1142
+ 68
1143
+ 69
1144
+ 70
1145
+ 71
1146
+ 72
1147
+ 73
1148
+ 74</pre>
1149
+ </td>
1150
+ <td>
1151
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 63</span>
1152
+
1153
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1154
+ <span class='kw'>return</span> <span class='kw'>unless</span> <span class='id identifier rubyid_should_log?'>should_log?</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='rparen'>)</span>
1155
+
1156
+ <span class='id identifier rubyid_structured_data'>structured_data</span> <span class='op'>=</span> <span class='id identifier rubyid_build_structured_log_entry'>build_structured_log_entry</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1157
+ <span class='id identifier rubyid_filtered_data'>filtered_data</span> <span class='op'>=</span> <span class='id identifier rubyid_apply_parameter_filtering'>apply_parameter_filtering</span><span class='lparen'>(</span><span class='id identifier rubyid_structured_data'>structured_data</span><span class='rparen'>)</span>
1158
+
1159
+ <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_public_send'>public_send</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='id identifier rubyid_format_log_output'>format_log_output</span><span class='lparen'>(</span><span class='id identifier rubyid_filtered_data'>filtered_data</span><span class='rparen'>)</span><span class='rparen'>)</span>
1160
+ <span class='kw'>rescue</span> <span class='const'>StandardError</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
1161
+ <span class='comment'># Failsafe logging - never let logging errors break application flow
1162
+ </span> <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_error'>error</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Structured logging failed: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
1163
+ <span class='const'>Rails</span><span class='period'>.</span><span class='id identifier rubyid_logger'>logger</span><span class='period'>.</span><span class='id identifier rubyid_public_send'>public_send</span><span class='lparen'>(</span><span class='id identifier rubyid_level'>level</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span> <span class='comment'># Fallback to simple logging
1164
+ </span><span class='kw'>end</span></pre>
1165
+ </td>
1166
+ </tr>
1167
+ </table>
1168
+ </div>
1169
+
1170
+ <div class="method_details ">
1171
+ <h3 class="signature " id="log_task_event-instance_method">
1172
+
1173
+ #<strong>log_task_event</strong>(task, event_type, **context) &#x21d2; <tt>void</tt>
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+ </h3><div class="docstring">
1180
+ <div class="discussion">
1181
+ <p class="note returns_void">This method returns an undefined value.</p>
1182
+ <p>Log task-related events with standardized format</p>
1183
+
1184
+
1185
+ </div>
1186
+ </div>
1187
+ <div class="tags">
1188
+
1189
+ <div class="examples">
1190
+ <h4 class="tag_title">Examples:</h4>
1191
+
1192
+
1193
+ <pre class="example code"><code><span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:started</span><span class='comma'>,</span> <span class='label'>execution_mode:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>async</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>priority:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>high</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
1194
+ <span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:completed</span><span class='comma'>,</span> <span class='label'>duration:</span> <span class='float'>120.5</span><span class='comma'>,</span> <span class='label'>step_count:</span> <span class='int'>5</span><span class='rparen'>)</span>
1195
+ <span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='symbol'>:failed</span><span class='comma'>,</span> <span class='label'>error:</span> <span class='id identifier rubyid_exception'>exception</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span><span class='rparen'>)</span></code></pre>
1196
+
1197
+ </div>
1198
+ <p class="tag_title">Parameters:</p>
1199
+ <ul class="param">
1200
+
1201
+ <li>
1202
+
1203
+ <span class='name'>task</span>
1204
+
1205
+
1206
+ <span class='type'>(<tt><span class='object_link'><a href="../Task.html" title="Tasker::Task (class)">Tasker::Task</a></span></tt>)</span>
1207
+
1208
+
1209
+
1210
+ &mdash;
1211
+ <div class='inline'>
1212
+ <p>The task object</p>
1213
+ </div>
1214
+
1215
+ </li>
1216
+
1217
+ <li>
1218
+
1219
+ <span class='name'>event_type</span>
1220
+
1221
+
1222
+ <span class='type'>(<tt>Symbol</tt>)</span>
1223
+
1224
+
1225
+
1226
+ &mdash;
1227
+ <div class='inline'>
1228
+ <p>The type of event (:started, :completed, :failed, etc.)</p>
1229
+ </div>
1230
+
1231
+ </li>
1232
+
1233
+ <li>
1234
+
1235
+ <span class='name'>context</span>
1236
+
1237
+
1238
+ <span class='type'>(<tt>Hash</tt>)</span>
1239
+
1240
+
1241
+
1242
+ &mdash;
1243
+ <div class='inline'>
1244
+ <p>Additional context to include in the log</p>
1245
+ </div>
1246
+
1247
+ </li>
1248
+
1249
+ </ul>
1250
+
1251
+
1252
+ </div><table class="source_code">
1253
+ <tr>
1254
+ <td>
1255
+ <pre class="lines">
1256
+
1257
+
1258
+ 129
1259
+ 130
1260
+ 131
1261
+ 132
1262
+ 133
1263
+ 134
1264
+ 135
1265
+ 136
1266
+ 137</pre>
1267
+ </td>
1268
+ <td>
1269
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 129</span>
1270
+
1271
+ <span class='kw'>def</span> <span class='id identifier rubyid_log_task_event'>log_task_event</span><span class='lparen'>(</span><span class='id identifier rubyid_task'>task</span><span class='comma'>,</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1272
+ <span class='id identifier rubyid_log_structured'>log_structured</span><span class='lparen'>(</span><span class='symbol'>:info</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Task </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_event_type'>event_type</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
1273
+ <span class='label'>entity_type:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>task</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span>
1274
+ <span class='label'>entity_id:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_task_id'>task_id</span><span class='comma'>,</span>
1275
+ <span class='label'>entity_name:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span>
1276
+ <span class='label'>event_type:</span> <span class='id identifier rubyid_event_type'>event_type</span><span class='comma'>,</span>
1277
+ <span class='label'>task_status:</span> <span class='id identifier rubyid_task'>task</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span><span class='comma'>,</span>
1278
+ <span class='op'>**</span><span class='id identifier rubyid_context'>context</span><span class='rparen'>)</span>
1279
+ <span class='kw'>end</span></pre>
1280
+ </td>
1281
+ </tr>
1282
+ </table>
1283
+ </div>
1284
+
1285
+ <div class="method_details ">
1286
+ <h3 class="signature " id="with_correlation_id-instance_method">
1287
+
1288
+ #<strong>with_correlation_id</strong>(id) { ... } &#x21d2; <tt>Object</tt>
1289
+
1290
+
1291
+
1292
+
1293
+
1294
+ </h3><div class="docstring">
1295
+ <div class="discussion">
1296
+
1297
+ <p>Execute a block with a specific correlation ID</p>
1298
+
1299
+
1300
+ </div>
1301
+ </div>
1302
+ <div class="tags">
1303
+
1304
+ <div class="examples">
1305
+ <h4 class="tag_title">Examples:</h4>
1306
+
1307
+
1308
+ <pre class="example code"><code><span class='id identifier rubyid_with_correlation_id'>with_correlation_id</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>req_abc123</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span>
1309
+ <span class='id identifier rubyid_process_workflow'>process_workflow</span>
1310
+ <span class='comment'># All logging within this block will include req_abc123
1311
+ </span><span class='kw'>end</span></code></pre>
1312
+
1313
+ </div>
1314
+ <p class="tag_title">Parameters:</p>
1315
+ <ul class="param">
1316
+
1317
+ <li>
1318
+
1319
+ <span class='name'>id</span>
1320
+
1321
+
1322
+ <span class='type'>(<tt>String</tt>)</span>
1323
+
1324
+
1325
+
1326
+ &mdash;
1327
+ <div class='inline'>
1328
+ <p>The correlation ID to use during block execution</p>
1329
+ </div>
1330
+
1331
+ </li>
1332
+
1333
+ </ul>
1334
+
1335
+ <p class="tag_title">Yields:</p>
1336
+ <ul class="yield">
1337
+
1338
+ <li>
1339
+
1340
+
1341
+ <span class='type'></span>
1342
+
1343
+
1344
+
1345
+
1346
+ <div class='inline'>
1347
+ <p>Block to execute with the correlation ID</p>
1348
+ </div>
1349
+
1350
+ </li>
1351
+
1352
+ </ul>
1353
+ <p class="tag_title">Returns:</p>
1354
+ <ul class="return">
1355
+
1356
+ <li>
1357
+
1358
+
1359
+ <span class='type'>(<tt>Object</tt>)</span>
1360
+
1361
+
1362
+
1363
+ &mdash;
1364
+ <div class='inline'>
1365
+ <p>The result of the yielded block</p>
1366
+ </div>
1367
+
1368
+ </li>
1369
+
1370
+ </ul>
1371
+
1372
+ </div><table class="source_code">
1373
+ <tr>
1374
+ <td>
1375
+ <pre class="lines">
1376
+
1377
+
1378
+ 106
1379
+ 107
1380
+ 108
1381
+ 109
1382
+ 110
1383
+ 111
1384
+ 112</pre>
1385
+ </td>
1386
+ <td>
1387
+ <pre class="code"><span class="info file"># File 'lib/tasker/concerns/structured_logging.rb', line 106</span>
1388
+
1389
+ <span class='kw'>def</span> <span class='id identifier rubyid_with_correlation_id'>with_correlation_id</span><span class='lparen'>(</span><span class='id identifier rubyid_id'>id</span><span class='rparen'>)</span>
1390
+ <span class='id identifier rubyid_previous_id'>previous_id</span> <span class='op'>=</span> <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#CORRELATION_ID_KEY-constant" title="Tasker::Concerns::StructuredLogging::CORRELATION_ID_KEY (constant)">CORRELATION_ID_KEY</a></span></span><span class='rbracket'>]</span>
1391
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#CORRELATION_ID_KEY-constant" title="Tasker::Concerns::StructuredLogging::CORRELATION_ID_KEY (constant)">CORRELATION_ID_KEY</a></span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_id'>id</span>
1392
+ <span class='kw'>yield</span>
1393
+ <span class='kw'>ensure</span>
1394
+ <span class='const'>Thread</span><span class='period'>.</span><span class='id identifier rubyid_current'>current</span><span class='lbracket'>[</span><span class='const'><span class='object_link'><a href="#CORRELATION_ID_KEY-constant" title="Tasker::Concerns::StructuredLogging::CORRELATION_ID_KEY (constant)">CORRELATION_ID_KEY</a></span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_previous_id'>previous_id</span>
1395
+ <span class='kw'>end</span></pre>
1396
+ </td>
1397
+ </tr>
1398
+ </table>
1399
+ </div>
1400
+
1401
+ </div>
1402
+
1403
+ </div>
1404
+
1405
+ <div id="footer">
1406
+ Generated on Tue Jul 1 16:47:35 2025 by
1407
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1408
+ 0.9.37 (ruby-3.2.4).
1409
+ </div>
1410
+
1411
+ </div>
1412
+ </body>
1413
+ </html>