feat(observability): 集成 OpenTelemetry 可观测性能力#243
Open
aaronwong1989 wants to merge 9 commits intomainfrom
Open
Conversation
…efs #214) - Add SessionContext fields to types.Config (Platform, UserID, ChannelID, etc.) - Add trace ID generator for distributed tracing - Enhance engine logs with semantic fields (platform, task_type, trace_id) - Add token recording with platform/task_type dimensions - Add brain/visual.go for event translation - Add brain/memory.go for context compression
- Fix rand.Read error handling in traceid.go - Fill Config observability fields in engine_handler.go - Add detectTaskType for automatic task classification - Update runner.go logs with semantic fields - Add dimensioned metrics methods in metrics.go - Add brain/visual.go for event translation Resolves review comments from PR #238
added 2 commits
March 8, 2026 13:37
- Run goimports on brain/config.go, brain/guard.go, brain/llm/metrics.go - Format chatapps/slack/builder.go, chatapps/slack/streaming_writer.go - Fix internal/secrets/provider.go, internal/telemetry/metrics.go - Format plugins/storage/interface.go and provider/*.go files Refs #214
…orage - Return error when WriteFile fails instead of ignoring the result - This prevents silent failures during export/backup operations Refs #214
aaronwong1989
pushed a commit
to aaronwong1989/hotplex
that referenced
this pull request
Mar 8, 2026
aaronwong1989
pushed a commit
to aaronwong1989/hotplex
that referenced
this pull request
Mar 8, 2026
- Fix race condition in GlobalVisualizer using sync.Once - Fix import grouping in engine_handler.go - Add logging for rand.Read errors in traceid.go - Add unit tests for detectTaskType function Refs hrygo#243 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Closed
added 5 commits
March 8, 2026 15:06
aaronwong1989
pushed a commit
to aaronwong1989/hotplex
that referenced
this pull request
Mar 8, 2026
aaronwong1989
pushed a commit
to aaronwong1989/hotplex
that referenced
this pull request
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
需求背景
当前 Hotplex 系统缺乏会话级别的可观测性能力,无法追踪:
这导致运维和优化决策缺乏数据支撑。
实现功能
1. 可观测性字段集成 (chatapps/engine_handler.go)
2. 结构化日志 (engine/runner.go)
3. 维度化指标 (internal/telemetry/metrics.go)
4. Trace ID 生成 (internal/trace/traceid.go)
5. Visualizer 事件翻译 (brain/visual.go)
测试
Related