GeezerVison is showing github.com — feat(telemetry): add OpenTelemetry instrumentation with Aspire Dashboard support by Hona · Pull Request #6629 · anomalyco/opencode
Conversation
Hona
commented
Jan 2, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
slang25 and stuartlang-je reacted with hooray emoji
Hona, slang25, stuartlang-je, and ThomasCarca reacted with rocket emoji
All reactions
-
🎉
2 reactions
-
🚀
4 reactions
Change experimental.openTelemetry config from boolean to union type
supporting both boolean and object with enabled/endpoint fields.
This allows users to configure custom OTLP endpoints for Aspire Dashboard
integration while maintaining backward compatibility with boolean config.
…tion
Add telemetry module with:
- Config interface and resolveConfig() for endpoint resolution
- init() function with NodeSDK, LoggerProvider, trace/log exporters
- shutdown() for graceful cleanup
- withSpan() helper for span creation with error handling
- isEnabled(), getTracer(), getLogger() utility functions
- SeverityMap for log level mapping
Integrate OpenTelemetry log emission into the Log module. When telemetry
is enabled, all log messages (debug/info/warn/error) are emitted to the
OTLP endpoint alongside file-based logging.
- Lazy-load telemetry module to avoid circular dependency
- Guard against recursive calls during module initialization
- Emit logs with proper severity levels using Telemetry.SeverityMap
- Initialize telemetry in yargs middleware after Log.init()
- Check OTEL_EXPORTER_OTLP_ENDPOINT env var or config.experimental.openTelemetry
- Register SIGTERM and SIGINT handlers for graceful shutdown
- Call Telemetry.shutdown() in finally block before process.exit()
…in.trigger chat.params, etc.)
…at span via onFinish, include tool parameters
…uild vs gen_ai.chat title)
…already emitted in onFinish)
This was referenced Mar 23, 2026
bbartels
commented
Mar 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
@Hona Saw your presentation at aspire conf yesterday! Was quite keen to try out the Aspire Dashboard for aspire. Would this PR be needed to get this to work?
And would this work with the final built artefact as opposed to just with the dev environment for opencode? We would mainly be interested in it to help us track down issues with our installations of opencode
|
slang25 reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I saw the talk too and really want this 😅 are there plans for this to be merged?
Great talk by the way
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
FYI robo-dax just closed #2666 and #6142 which I was also interested in for otel monitoring of opencode. Will this PR include those features?
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Automated PR Cleanup
Thank you for contributing to opencode.
Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.
This PR was closed because it matched the following cleanup criteria:
- The PR was created more than 1 month ago
- The PR had fewer than 2 positive reactions
- Positive reactions are counted as thumbs-up or heart reactions on the PR
PRs created within the last month are not affected by this cleanup.
If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.
Thanks again for taking the time to contribute.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|