Skip to content

fix(openai): attribute Azure Government requests to Azure - #502

Open
nik13 wants to merge 2 commits into
devfrom
fix/openai-azure-government-provider
Open

nik13 wants to merge 2 commits into
devfrom
fix/openai-azure-government-provider

Conversation

@nik13

@nik13 nik13 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Azure Government OpenAI requests already produce spans, but their provider is incorrectly recorded as openai. Recognize Microsoft's documented .openai.azure.us resource suffix as azure in the shared OpenAI provider lookup.

  • Keep OpenAIInstrumentor and all existing client entry points; no extra instrumentor, package, or duplicate spans.
  • Preserve the existing fallback for custom gateways and look-alike domains.
  • Document Azure v1 and versioned-client setup, deployment-name semantics, and the separate trace-export destination.

Microsoft documents the Government endpoint in its Azure cloud comparison. This fixes the existing shared package rather than adding the separate Azure wrapper proposed in #156.

Verification

Regression tests exercise real sync/async OpenAI and AzureOpenAI clients for chat, streaming, errors, embeddings, and Responses, with loopback OTLP JSON/protobuf receivers and plain/gzip payloads. The README examples run verbatim with mocked vendor HTTP transport. Host-boundary tests reject look-alikes.

The package suite passes on OpenAI 1.69.0 and 3.42.0; clean wheel and sdist installations pass the Azure and README contracts. Tests use synthetic credentials with outbound networking blocked except localhost. No Azure service or Future AGI backend validation is claimed.

No version bump or release metadata change; release-please owns the next package version. The docs-site addition is held until the corrected package is released.

🤖 Generated with Claude Code

nik13 and others added 2 commits October 31, 2026 20:53
Recognize the documented Azure Government OpenAI resource suffix in the shared provider lookup. Cover Azure and standard clients with SDK, wire-format, and README regressions.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant