Optimize Daily OTel Instrumentation Advisor with inline sub-agents#36028
Merged
pelikhan merged 4 commits intoMay 31, 2026
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize Daily OTel Instrumentation Advisor workflow
Optimize Daily OTel Instrumentation Advisor with inline sub-agents
May 31, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the “Daily OTel Instrumentation Advisor” workflow prompt to delegate two high-context extractive phases (static instrumentation inspection and live telemetry sampling) to inline small sub-agents, keeping the main workflow focused on synthesis and issue authoring.
Changes:
- Replaced verbose Step 1 static-code inspection instructions with an
otel-code-inspectorsub-agent invocation. - Replaced verbose Step 2 live telemetry querying instructions with an
otel-telemetry-samplersub-agent invocation. - Regenerated the compiled lock workflow for the OTel advisor (and also includes a regeneration of
daily-news.lock.yml).
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/daily-otel-instrumentation-advisor.md | Delegates code inspection and telemetry sampling to inline small sub-agents and adds the agent definitions. |
| .github/workflows/daily-otel-instrumentation-advisor.lock.yml | Updates compiled lock metadata to reflect the new prompt body. |
| .github/workflows/daily-news.lock.yml | Regenerated lock metadata/heredoc IDs without an accompanying .md change in this PR. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 4
Comment on lines
+74
to
+79
| Invoke the `otel-telemetry-sampler` agent (no arguments). It queries Sentry and | ||
| Grafana for recent gh-aw spans and returns a per-backend attribute-presence table | ||
| plus a sampled trace_id. After the agent returns its two backend tables, cross-check | ||
| them yourself and note any discrepancies (attribute present in one backend but absent | ||
| in the other, or signs of ingestion delay vs. auth/config issues). Record the result | ||
| to memory for Step 3. |
| 1. **Sentry**: call `find_organizations`, then `find_projects`, then `search_events` with `dataset: spans` (fall back to `dataset: transactions` if empty). Take one `trace_id` and call `get_trace_details`. | ||
| 2. **Grafana**: use `list_datasources`, `tempo_traceql-search`, then `tempo_get-trace` on one trace ID. | ||
|
|
||
| For each backend, return a markdown table with one row per attribute — `service.version`, `github.repository`, `github.event_name`, `github.run_id`, `deployment.environment` — and a Present/Absent column. Include the sampled `trace_id` and span `name`. If a backend returned no data, state whether it looks like ingestion delay, auth/config, or query limits. Report findings only. |
| - `actions/setup/js/generate_observability_summary.cjs` | ||
| - `actions/setup/js/aw_context.cjs` | ||
|
|
||
| Also inspect broader usage with targeted `grep -n` commands under `actions/setup/js/` for OTLP/otel references. |
| @@ -1,4 +1,4 @@ | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"847860af3924384aa2f4bd0188a573e31264f6225f10ed1ff1dd8cb0ca014fe5","body_hash":"55ac3a789fdbd8eca450f17c99cb9b78e5eafede9392b9e5444dce5e97f9cbee","strict":true,"agent_id":"copilot"} | |||
| # gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"8d41a250f29248203bc447b1d39fe538173aa7b849fdbc6d8c2dadeb04b5d229","body_hash":"55ac3a789fdbd8eca450f17c99cb9b78e5eafede9392b9e5444dce5e97f9cbee","strict":true,"agent_id":"copilot"} | |||
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.
The Daily OTel Instrumentation Advisor was spending a large share of Claude context on two extractive phases: reading the OTel instrumentation sources and sampling live telemetry from Sentry/Grafana. This change moves those phases behind inline
smallsub-agents while keeping the cross-source evaluation and issue-authoring steps in the main workflow.Prompt flow
otel-code-inspectorinvocationotel-telemetry-samplerinvocationInline sub-agents
otel-code-inspectorto extract:otel-telemetry-samplerto collect:trace_idand span nameCompiled workflow
Example of the new delegation pattern: