-
Notifications
You must be signed in to change notification settings - Fork 8
Use Agent365ExporterOptions for exporter and create AgenticTokenCache… #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
996b5e7
use Agent365ExporterOptions for exporter and create AgenticTokenCache…
jsl517 9c50c72
tests
jsl517 51b4d86
copilot comment
jsl517 a0de073
configure batch span processor
jsl517 88605eb
copilot comment
jsl517 ca17b96
checkpoint to use cached context and authorization to exchange token.
jsl517 1b89510
only do refresh token in message handler, unit tests
jsl517 fa95349
sample update
jsl517 1c3940e
comments
jsl517 36c5966
comments
jsl517 3d174b3
observability always use prod
jsl517 9ca9f6a
Merge branch 'main' into users/pefan/exportoption
jsl517 7271de5
should be lowercase
jsl517 ea0cfc6
Revert "observability always use prod"
jsl517 5221582
Merge branch 'main' into users/pefan/exportoption
jsl517 64728ca
default to prod
jsl517 f1d9e61
expose Agent365ExporterOptions
jsl517 e07318b
expose Agent365ExporterOptions
jsl517 057aae7
move azure token cache to its own package
jsl517 20133be
readme update
jsl517 d322096
Merge branch 'main' into users/pefan/exportoption
jsl517 6058c84
fix package.json error
jsl517 1149e09
fix logging
jsl517 5e3d93b
lint,jest config
jsl517 55b5536
cleanup
jsl517 cf31254
comment
jsl517 142ec28
rename
jsl517 54ddd3e
lint
jsl517 5303929
comment
jsl517 0b11ffa
Merge branch 'main' into users/pefan/exportoption
fpfp100 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
51 changes: 51 additions & 0 deletions
51
packages/agents-a365-observability/src/tracing/exporter/Agent365ExporterOptions.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // ------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
| // ------------------------------------------------------------------------------ | ||
|
|
||
| import { ClusterCategory } from '@microsoft/agents-a365-runtime'; | ||
| /** | ||
| * A function that resolves and returns an authentication token for the given agent and tenant. | ||
| * Implementations may perform synchronous lookup (e.g., in-memory cache) or asynchronous network calls. | ||
| * Return null if a token cannot be provided; exporter will log and proceed without an authorization header. | ||
| */ | ||
| export type TokenResolver = (agentId: string, tenantId: string) => string | null | Promise<string | null>; | ||
|
|
||
| /** | ||
| * Options controlling the behavior of the Agent365 OpenTelemetry span exporter. | ||
| * | ||
| * These values tune batching, timeouts, token acquisition and endpoint shape. All properties have sensible | ||
| * defaults so callers can usually construct without arguments and override selectively. | ||
| * | ||
| * @property {ClusterCategory | string} clusterCategory Environment / cluster category (e.g. "preprod", "prod"). | ||
| * @property {TokenResolver} [tokenResolver] Optional delegate to obtain an auth token. If omitted the exporter will | ||
| * fall back to reading the cached token (AgenticTokenCacheInstance.getObservabilityToken). | ||
|
fpfp100 marked this conversation as resolved.
|
||
| * @property {boolean} useS2SEndpoint When true uses service-to-service path (/maven/agent365/service/agents/{agentId}/traces); | ||
| * when false uses the standard path (/maven/agent365/agents/{agentId}/traces). | ||
|
fpfp100 marked this conversation as resolved.
Outdated
|
||
| * @property {number} maxQueueSize Maximum span queue size before drops occur (passed to BatchSpanProcessor). | ||
| * @property {number} scheduledDelayMilliseconds Delay between automatic batch flush attempts. | ||
| * @property {number} exporterTimeoutMilliseconds Per-export timeout (abort if exceeded). | ||
| * @property {number} maxExportBatchSize Maximum number of spans per export batch. | ||
| */ | ||
| export class Agent365ExporterOptions { | ||
| /** Environment / cluster category (e.g. "preprod", "prod"). */ | ||
| public clusterCategory: ClusterCategory | string = 'preprod'; | ||
|
|
||
| /** Optional delegate to resolve auth token; falls back to AgenticTokenCache when absent. */ | ||
| public tokenResolver?: TokenResolver; | ||
|
|
||
| /** Use service-to-service endpoint variant when true; standard endpoint when false. */ | ||
| public useS2SEndpoint: boolean = false; | ||
|
fpfp100 marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** Maximum span queue size before new spans are dropped. */ | ||
| public maxQueueSize: number = 2048; | ||
|
|
||
| /** Delay (ms) between automatic batch flush attempts. */ | ||
| public scheduledDelayMilliseconds: number = 5000; | ||
|
|
||
| /** Per-export timeout in milliseconds. */ | ||
| public exporterTimeoutMilliseconds: number = 30000; | ||
|
|
||
| /** Maximum number of spans per export batch. */ | ||
| public maxExportBatchSize: number = 512; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.