feat: add Fabric LLM traffic metadata - #2656
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey Rana Singh (@ranadeepsingh) 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds SynapseML-owned Fabric request attribution for OpenAI stages by injecting X-Taxonomy-ExtendedProperties only when running on Fabric and using the implicit Fabric OpenAI endpoint, while leaving explicit endpoints and custom URL roots caller-controlled.
Changes:
- Introduces a stackable
HasOpenAIFabricHeaderstrait that conditionally injects Fabric taxonomy metadata into request headers. - Wires the new trait into
OpenAIChatCompletion,OpenAIEmbedding, andOpenAIResponses. - Adds a new Scala test suite covering Fabric vs non-Fabric, default vs explicit endpoints, and custom URL roots (currently via
OpenAIChatCompletion).
Show a summary per file
| File | Description |
|---|---|
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAI.scala | Adds Fabric endpoint/runtime detection hooks and the new HasOpenAIFabricHeaders header-injection trait. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIChatCompletion.scala | Mixes HasOpenAIFabricHeaders into Chat Completion stage. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIEmbedding.scala | Mixes HasOpenAIFabricHeaders into Embedding stage. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIResponses.scala | Mixes HasOpenAIFabricHeaders into Responses stage. |
| cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAIFabricHeadersSuite.scala | Adds tests validating extended-properties injection/omission behavior (currently only exercised through Chat Completion). |
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
AB#5520317 ## Summary Make SynapseML-owned Fabric extended properties override caller headers case-insensitively and expand regression coverage across chat completion, embedding, and Responses stages. ## Prompting Intent The engineer asked to run the repository's SynapseML PR readiness loop and polish PR microsoft#2656 until its implementation, tests, metadata, and validation evidence are merge-ready. ## Linked Sources - Pull request: microsoft#2656 - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale HTTP header names are case-insensitive, so replacing only the canonical key could emit conflicting duplicate metadata when callers use different casing. Filter all case variants before adding the service-owned value, and exercise every OpenAI stage that mixes in the shared header trait. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
921059e to
a223cd8
Compare
|
/azp run |
1 similar comment
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
AB#5520317 ## Summary Align Fabric metadata injection with the actual custom URL routing rule, sanitize raw Spark-param header maps, and verify inclusion and omission across all supported OpenAI stages. ## Prompting Intent The engineer asked to run the SynapseML PR readiness loop for PR microsoft#2656 and fix all current-head automated review findings with regression evidence. ## Linked Sources - Pull request: microsoft#2656 - Custom URL review: microsoft#2656 (comment) - Stage coverage review: microsoft#2656 (comment) - Null-header review: microsoft#2656 (comment) - Fabric taxonomy guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale Header ownership must follow the same parameter-presence rule used to select custom request URLs, including blank values. Raw Spark params can bypass public setter normalization, so the shared sanitizer is applied before case-insensitive comparisons. Positive and negative assertions now cover chat, embedding, and Responses stages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
PR loop CI triageFinal head Azure build 231583050 is
No PR test ran in that lane. The current spark4.1 branch already contains the sanitizer behavior introduced by that prerequisite through its sync commit, but |
AB#5520317 ## Summary Add SynapseML-owned Fabric LLM extended properties to OpenAI chat completion, embedding, and Responses requests, identifying the feature as synapseml and including the detected runtime. ## Prompting Intent The engineer asked for a separate public SynapseML change that sends X-Taxonomy-ExtendedProperties with feature set to synapseml while preserving caller-owned behavior for non-Fabric and explicitly configured endpoints. ## Linked Sources - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale Implement the metadata as a stackable request-header trait shared by all three OpenAI request surfaces. Restrict ownership to the implicit Fabric endpoint so explicit endpoints and custom URL roots remain fully caller-controlled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
AB#5520317 ## Summary Make SynapseML-owned Fabric extended properties override caller headers case-insensitively and expand regression coverage across chat completion, embedding, and Responses stages. ## Prompting Intent The engineer asked to run the repository's SynapseML PR readiness loop and polish PR microsoft#2656 until its implementation, tests, metadata, and validation evidence are merge-ready. ## Linked Sources - Pull request: microsoft#2656 - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale HTTP header names are case-insensitive, so replacing only the canonical key could emit conflicting duplicate metadata when callers use different casing. Filter all case variants before adding the service-owned value, and exercise every OpenAI stage that mixes in the shared header trait. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
AB#5520317 ## Summary Align Fabric metadata injection with the actual custom URL routing rule, sanitize raw Spark-param header maps, and verify inclusion and omission across all supported OpenAI stages. ## Prompting Intent The engineer asked to run the SynapseML PR readiness loop for PR microsoft#2656 and fix all current-head automated review findings with regression evidence. ## Linked Sources - Pull request: microsoft#2656 - Custom URL review: microsoft#2656 (comment) - Stage coverage review: microsoft#2656 (comment) - Null-header review: microsoft#2656 (comment) - Fabric taxonomy guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale Header ownership must follow the same parameter-presence rule used to select custom request URLs, including blank values. Raw Spark params can bypass public setter normalization, so the shared sanitizer is applied before case-insensitive comparisons. Positive and negative assertions now cover chat, embedding, and Responses stages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
AB#5520317 ## Summary Send traffic type, service tier, and extended properties together from the shared SynapseML Fabric OpenAI header trait for chat completion, embedding, and Responses requests. ## Prompting Intent The engineer asked why PR microsoft#2656 only showed ExtendedProperties and requested that all three Fabric workload headers be owned and emitted together. ## Linked Sources - Pull request: microsoft#2656 - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale SynapseML is the common owner of implicit Fabric OpenAI requests, so keeping Background/flex classification beside feature/runtime attribution avoids partial metadata and inconsistent behavior across OpenAI stages. All three headers use the same Fabric-only guard and case-insensitive ownership rules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
6642948 to
49d6343
Compare
|
/azp run |
|
Updated in |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
1 similar comment
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
AB#5520317 ## Summary Rename the filtered caller-header map so the consolidated Fabric header merge is easier to reason about and maintain. ## Prompting Intent The engineer asked to keep polishing PR microsoft#2656 and address current-head review feedback after consolidating all three Fabric workload headers. ## Linked Sources - Pull request: microsoft#2656 - Review comment: microsoft#2656 (comment) - Fabric taxonomy guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale The map contains caller headers that remain after removing service-owned names, so `remainingHeaders` accurately describes its contents and avoids implying that the retained values are owned by SynapseML. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Final three-header CI statusFinal head |
43f31cb
into
microsoft:master
AB#5520317 ## Summary Make SynapseML-owned Fabric extended properties override caller headers case-insensitively and expand regression coverage across chat completion, embedding, and Responses stages. ## Prompting Intent The engineer asked to run the repository's SynapseML PR readiness loop and polish PR #2656 until its implementation, tests, metadata, and validation evidence are merge-ready. ## Linked Sources - Pull request: #2656 - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale HTTP header names are case-insensitive, so replacing only the canonical key could emit conflicting duplicate metadata when callers use different casing. Filter all case variants before adding the service-owned value, and exercise every OpenAI stage that mixes in the shared header trait. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
AB#5520317 ## Summary Align Fabric metadata injection with the actual custom URL routing rule, sanitize raw Spark-param header maps, and verify inclusion and omission across all supported OpenAI stages. ## Prompting Intent The engineer asked to run the SynapseML PR readiness loop for PR #2656 and fix all current-head automated review findings with regression evidence. ## Linked Sources - Pull request: #2656 - Custom URL review: #2656 (comment) - Stage coverage review: #2656 (comment) - Null-header review: #2656 (comment) - Fabric taxonomy guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale Header ownership must follow the same parameter-presence rule used to select custom request URLs, including blank values. Raw Spark params can bypass public setter normalization, so the shared sanitizer is applied before case-insensitive comparisons. Positive and negative assertions now cover chat, embedding, and Responses stages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
AB#5520317 ## Summary Send traffic type, service tier, and extended properties together from the shared SynapseML Fabric OpenAI header trait for chat completion, embedding, and Responses requests. ## Prompting Intent The engineer asked why PR #2656 only showed ExtendedProperties and requested that all three Fabric workload headers be owned and emitted together. ## Linked Sources - Pull request: #2656 - Repair work item: https://dev.azure.com/msdata/A365/_workitems/edit/5520317 - Fabric taxonomy and class-of-service guide: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - AI Functions draft PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale SynapseML is the common owner of implicit Fabric OpenAI requests, so keeping Background/flex classification beside feature/runtime attribution avoids partial metadata and inconsistent behavior across OpenAI stages. All three headers use the same Fabric-only guard and case-insensitive ownership rules. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
* Report versioned Fabric runtime in OpenAI metadata AB#5533937 ## Summary Add a cached Fabric runtime identity to PlatformDetails and use it in SynapseML OpenAI extended properties. Fabric requests now report fabric_spark_<spark_version>, fall back to fabric_python_<python_version> when Spark is unavailable, and finally use fabric. ## Prompting Intent The engineer asked for a new SynapseML follow-up PR that replaces the generic runtime value in Fabric LLM taxonomy metadata with versioned Spark or Python runtime attribution and ensures detection is performed only once. ## Linked Sources - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 - Prior header PR: #2656 - Fabric taxonomy guidance: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale Place runtime detection in shared PlatformDetails rather than the OpenAI header trait so the taxonomy value has one owner. A lazy value guarantees one-time process detection. Spark version is authoritative for SynapseML JVM execution; an environment or JVM Python version remains available as a defensive fallback before the generic fabric value. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c * Align and cache Fabric runtime header metadata AB#5533937 ## Summary Align SynapseML runtime resolution exactly with SynapseML-Internal and initialize the complete fixed Fabric LLM classification header map once per JVM. Reuse that immutable map across OpenAI request rows while preserving request-specific custom-header merging. ## Prompting Intent The engineer asked to make the SynapseML follow-up use the same runtime algorithm as SynapseML-Internal and ensure all runtime-stable headers are initialized once rather than rebuilt for repeated requests. ## Linked Sources - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 - Pull request: #2665 - Internal AI Functions PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 - Fabric guidance: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html ## Rationale A JVM-wide lazy immutable map avoids repeated JSON serialization and classification-map allocation. Headers are still attached to every outbound request, as required by HTTP, while only caller-specific merging remains per request. Matching the internal resolver removes the extra JVM property fallback and keeps both codebases behaviorally identical. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c * Use unknown runtime outside Fabric AB#5533937 ## Summary Return `unknown` from SynapseML Fabric runtime metadata when Fabric detection is false, while retaining versioned Spark and Python runtime values on Fabric. ## Prompting Intent The engineer clarified that SynapseML can run on Databricks or locally and requested an unknown runtime when the Synapse-internal/Fabric helper returns false. Keep the public and internal implementations aligned. ## Linked Sources - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 - Pull request: #2665 - Internal AI Functions PR: https://dev.azure.com/msdata/A365/_git/SynapseML-Internal/pullrequest/2253680 ## Rationale The taxonomy runtime field is intended to describe Fabric execution. Mapping non-Fabric platforms such as Databricks into that field would create misleading categories, so a stable `unknown` fallback is clearer and consistent across implementations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c * Fix Fabric runtime review findings AB#5533937 ## Summary Guard Spark version lookup so the Python/Fabric fallback remains safe when Spark linkage is unavailable, and rename cached header fields to satisfy SynapseML Scala style rules. ## Prompting Intent Run the SynapseML PR readiness loop, address every current-head review finding, and make all required validation checks pass. ## Linked Sources - Pull request: #2665 - Review thread: #2665 (comment) - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 ## Rationale Catching Spark linkage failure at the version lookup preserves the documented fallback without changing the normal Spark-first path. Renaming object fields fixes the CI style failure while retaining one-time immutable header initialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c * Clarify canonical Fabric header capitalization AB#5533937 ## Summary Inline the canonical Fabric LLM taxonomy and service-tier wire names where the cached SynapseML header map is built. ## Prompting Intent The engineer asked to review all related repositories and PRs for exact header capitalization, calling out SynapseML PR #2665 as misleading or incorrect. ## Linked Sources - Fabric taxonomy and class-of-service guidance: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - SynapseML PR: #2665 - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 ## Rationale The emitted wire names already matched the documented contract. Inlining the exact literals removes confusion caused by Scala object-field capitalization while retaining JVM-wide cached header construction and making review against the specification direct. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c * Match Fabric service-tier header capitalization AB#5533937 ## Summary Emit the Fabric LLM service-tier header as `X-Llm-Service-Tier` and update the exact-casing regression test. ## Prompting Intent The engineer clarified that the Fabric documentation requires `X-Llm-Service-Tier` and asked for consistent capitalization across SynapseML, SynapseML-Internal, and workload-ml. ## Linked Sources - Fabric taxonomy and class-of-service guidance: https://eng.ms/docs/synapse-data-science-fabric-product-synapse-data-science/llmendpoint/partnerdocs/taxonomyandclassofservice.html - SynapseML PR: #2665 - Work item: https://dev.azure.com/msdata/A365/_workitems/edit/5533937 ## Rationale Although HTTP header lookup is case-insensitive, emitting the documented spelling keeps telemetry, diagnostics, tests, and code review aligned with the Fabric contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c --------- Co-authored-by: SynapseML CI <synapseml-ci@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d835d0c8-9ce7-4f84-99a6-a7c87b24058c
Summary
Attribute implicit Fabric OpenAI traffic from SynapseML so the Fabric LLM endpoint receives the complete workload classification without requiring callers to configure headers:
The header is added only when SynapseML uses the implicit Fabric OpenAI endpoint. Non-Fabric execution, explicit OpenAI endpoints, and custom URL roots remain caller-controlled and receive no SynapseML-owned extended properties.
Compatibility
Implementation
HasOpenAIFabricHeadersrequest-header trait that sends traffic type, service tier, and extended properties together across all three OpenAI request surfaces.PlatformDetails.CurrentPlatformfor runtime attribution.Validation
masterat7fd1a0b86762ca54c0a4ef7306e1d0f8827fb613.OpenAIFabricHeadersSuite: 6 passed, including blank custom URL roots and raw null header entries.git diff --check: passed.References
AB#5520317 - Fabric LLM Endpoint contract compliance
Fabric LLM Endpoint taxonomy and class-of-service guidance
AI Functions draft PR #2253680
AB#5533937 - Add Fabric LLM taxonomy headers to SynapseML