Allow setting PerRequestSpanProcessor without directly exporting the …#195
Merged
Allow setting PerRequestSpanProcessor without directly exporting the …#195
Conversation
…configuration methods at index level.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an internal override mechanism to enable per-request span exporting and to override PerRequestSpanProcessor guardrail settings without exposing additional configuration APIs at the package index level.
Changes:
- Introduces
PerRequestProcessorOverridesinternal module with get/set APIs for per-request export and processor guardrail overrides. - Updates
isPerRequestExportEnabled()to honor internal overrides before consulting configuration. - Updates
PerRequestSpanProcessorto apply internal override guardrails and adds tests covering override behavior and builder selection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/observability/internal/PerRequestProcessorOverrides.test.ts | Adds Jest coverage for override round-tripping, enablement precedence, and guardrail override application. |
| packages/agents-a365-observability/src/tracing/exporter/utils.ts | Checks internal overrides in isPerRequestExportEnabled() before config provider/env-driven configuration. |
| packages/agents-a365-observability/src/tracing/PerRequestSpanProcessor.ts | Applies internal override guardrail values when constructing the processor. |
| packages/agents-a365-observability/src/internal/PerRequestProcessorOverrides.ts | New internal module holding override state and exported override types. |
packages/agents-a365-observability/src/internal/PerRequestProcessorOverrides.ts
Outdated
Show resolved
Hide resolved
packages/agents-a365-observability/src/internal/PerRequestProcessorOverrides.ts
Outdated
Show resolved
Hide resolved
packages/agents-a365-observability/src/tracing/PerRequestSpanProcessor.ts
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts:33
- The class-level documentation and the "Inherited" comment still state that
PerRequestSpanProcessorConfigurationinherits observability settings (e.g.,isObservabilityExporterEnabled,observabilityLogLevel). After changing the base class toRuntimeConfiguration, those properties are no longer part of this configuration, so the comments are now misleading and should be updated accordingly.
* Configuration for PerRequestSpanProcessor.
* Inherits all observability and runtime settings, and adds per-request processor guardrails.
*
* This is separated from ObservabilityConfiguration because PerRequestSpanProcessor
* is used only in specific scenarios and these settings should not be exposed
* in the common ObservabilityConfiguration.
*/
export class PerRequestSpanProcessorConfiguration extends RuntimeConfiguration {
protected get perRequestOverrides(): PerRequestSpanProcessorConfigurationOptions {
return getPerRequestProcessorInternalOverrides() ?? this.overrides as PerRequestSpanProcessorConfigurationOptions;
}
constructor(overrides?: PerRequestSpanProcessorConfigurationOptions) {
super(overrides);
}
// Inherited: clusterCategory, isDevelopmentEnvironment, isNodeEnvDevelopment,
// observabilityAuthenticationScopes, isObservabilityExporterEnabled,
// useCustomDomainForObservability, observabilityDomainOverride, observabilityLogLevel
...s/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfigurationOptions.ts
Show resolved
Hide resolved
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts
Outdated
Show resolved
Hide resolved
packages/agents-a365-observability/src/internal/PerRequestProcessorInternalOverrides.ts
Outdated
Show resolved
Hide resolved
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts
Show resolved
Hide resolved
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts
Show resolved
Hide resolved
packages/agents-a365-observability/src/internal/PerRequestProcessorInternalOverrides.ts
Outdated
Show resolved
Hide resolved
tests/observability/internal/PerRequestProcessorOverrides.test.ts
Outdated
Show resolved
Hide resolved
tests/observability/internal/PerRequestProcessorOverrides.test.ts
Outdated
Show resolved
Hide resolved
packages/agents-a365-observability/src/tracing/PerRequestSpanProcessor.ts
Show resolved
Hide resolved
packages/agents-a365-observability/src/internal/PerRequestProcessorInternalOverrides.ts
Show resolved
Hide resolved
62a255a to
928e495
Compare
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts
Outdated
Show resolved
Hide resolved
nikhilNava
requested changes
Feb 13, 2026
packages/agents-a365-observability/src/configuration/PerRequestSpanProcessorConfiguration.ts
Outdated
Show resolved
Hide resolved
nikhilNava
previously approved these changes
Feb 13, 2026
Contributor
Author
|
@copilot open a new pull request to apply changes based on the comments in this thread |
nikhilNava
approved these changes
Feb 17, 2026
juliomenendez
approved these changes
Feb 17, 2026
fpfp100
added a commit
that referenced
this pull request
Feb 19, 2026
#195) * allow setting PerRequestSpanProcessor without directly exporting the configuration methods at index level. * comments * clean up to use existing class * comment * remove tasks.json * comment * add max age and default grace period * comment * update comment --------- Co-authored-by: jsl517 <pefan@microsoft.com>
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.
Allow setting PerRequestSpanProcessor without directly exporting the configuration methods at index level.