Skip to content

Fix signal-aware OTLP protobuf logs and Azure log endpoints - #74729

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/otlp-log-transport
Nov 4, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/otlp-log-transport

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Compact-session log exports fail before making a network request when OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf because the shared transport passes resourceLogs to the trace-only encoder. Azure logs also incorrectly retain the Microsoft-OTLP-Traces stream segment.

  • Select OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_TRACES_PROTOCOL independently, with the global protocol as the fallback.
  • Encode logs as ExportLogsServiceRequest, reusing the existing typed AnyValue, resource, and scope encoding while preserving exact timestamps and trace/span IDs.
  • Resolve Azure logs to Microsoft-OTLP-Logs/otlp/v1/logs, preserving DCE, DCR, query parameters, and per-collector credentials. Existing trace and generic collector behavior is unchanged.
  • Add focused encoding, direct/proxy transport, endpoint, and compact-session regressions, and document signal-specific protocol behavior and Azure's separate logs stream.

Existing compiler configuration is sufficient; no new frontmatter fields or credentials are required. The Azure DCR must support the logs stream.

Validation

  • make fmt-cjs && make lint-cjs passed.
  • npm --prefix actions/setup/js run typecheck passed.
  • make agent-report-progress passed, including 103 encoding/session-log tests.
  • 46 existing trace transport and endpoint tests passed.
  • JSON and protobuf compact-session requests were delivered to a real local collector; proxy tests verify binary-safe bodies and isolated credentials.

The broader send_otlp_span.test.cjs suite has two unrelated AI-credit assertion failures (442 tests passed). The same behavior was reproduced with the unmodified HEAD exporter: it emits intValue:1000 for both a 1000.5 and an invalid environment budget. Those pre-existing failures are outside this fix.

No live workflow dispatch or Azure deployment was performed.

Select logs protocol independently, encode ExportLogsServiceRequest, and route Azure session logs to the Microsoft-OTLP-Logs stream. Preserve per-collector credentials and existing trace transport behavior.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 4, 2026 03:54
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 03:54
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: opus55 medium · ~12 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #74729

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · routed: gpt56 max · ~1 AIC · ⌖ ~1 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changed encoder, transport, session-log, and documentation paths. I found no actionable correctness, performance, or security issues in the changed lines. The specialist pass was unavailable because it returned partial, non-JSONL output after a tool-permission failure; final assessment is based on the independent static review.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the signal-specific OTLP encoding and Azure log-routing changes.

No open issues 🎉

What changed in this PR

This PR fixes compact-session log exports in gh-aw by adding signal-aware OTLP protobuf encoding and routing Azure logs to their separate stream.

Changes:

  • Select trace and log protocols independently and encode logs as ExportLogsServiceRequest.
  • Rewrite Azure log endpoints to Microsoft-OTLP-Logs while preserving query parameters and per-endpoint credentials.
  • Add encoding, transport, and compact-session regression tests, and document the configuration.
File Description
docs/​src/​content/​docs/​reference/​open-telemetry.mdx Documents signal-specific protocols and Azure logs routing.
docs/​src/​content/​docs/​reference/​compiler-enterprise-environment-controls.md Clarifies compact-session encoding, byte limits, and endpoint behavior.
actions/​setup/​js/​send_otlp_span.cjs Selects the matching protocol, encoder, and endpoint for each signal.
actions/​setup/​js/​send_otlp_session_logs.test.cjs Adds protobuf session-export and local-collector coverage.
actions/​setup/​js/​otlp_protobuf.test.cjs Tests log encoding, protocol isolation, proxy transport, and Azure routing.
actions/​setup/​js/​otlp_protobuf.cjs Adds the logs protobuf encoder and shares resource and scope definitions.

Review effort: Balanced (auto)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this change does: It adds a separate OTLP protobuf encoder for logs and routes traces and logs through signal-specific protocols and Azure endpoints. The changed tests cover encoding, direct and proxy transport, compact sessions, and the documented configuration.

Nice to have:

  1. Azure logs test repeats identical assertions (actions/setup/js/otlp_protobuf.test.cjs:L302-317)

    • What this is: The test runs the same endpoint-rewrite assertions once for JSON and once for protobuf.
    • Problem: It does not assert either body or Content-Type, and both protocols are already covered by the preceding transport test, so the second case adds no signal.
    • Fix: Keep one default-protocol case here and leave wire-format checks in the transport test.
    • If we skip it: Future Azure endpoint changes must maintain a duplicated case whose assertions cannot distinguish the protocols.

Verdict: Ship.
Lean: -1 lines possible.

Generated by ✂️ Ponytail Reviewer for #74729 · codex · routed: gpt56 max · ~4 AIC · ⌖ ~1 AIC · ⊞ 118
Comment /ponytail to run again

expect(secondOptions.input).toEqual(firstOptions.input);
});

it.each(["http/json", "http/protobuf"])("uses the independent Azure logs stream with %s on both transports", async protocol => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What this is: This matrix runs the same Azure URL assertions once per wire protocol. Problem: This test never checks the body or Content-Type, and both protocols are already covered by the preceding proxy test, so the second run adds no coverage. Fix: Use one default-protocol case here and keep encoding assertions in the transport test. If we skip it: The test stays duplicated and future Azure endpoint edits must maintain two indistinguishable cases.

@pelikhan
pelikhan merged commit 75bc0ed into main Nov 4, 2026
96 checks passed
@pelikhan
pelikhan deleted the pelikhan/otlp-log-transport branch November 4, 2026 04:05
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants