@cuylabs/agent-microsoft-opentelemetry 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +173 -0
- package/dist/chunk-S7XVXBY3.js +966 -0
- package/dist/index.d.ts +440 -0
- package/dist/index.js +363 -0
- package/dist/loader.d.ts +2 -0
- package/dist/loader.js +3 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.js +17 -0
- package/docs/architecture.md +110 -0
- package/docs/destinations-and-instrumentation.md +116 -0
- package/docs/distro-alignment.md +123 -0
- package/docs/env.md +76 -0
- package/examples/01-agent365-s2s.ts +40 -0
- package/package.json +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { TelemetryOptions } from 'ai';
|
|
2
|
+
import { AgentTurnSourceChatOptions, AgentTurnSource } from '@cuylabs/agent-core';
|
|
3
|
+
|
|
4
|
+
type MicrosoftOpenTelemetryTokenResolver = (agentId: string, tenantId: string, authScopes?: string[]) => string | null | Promise<string | null>;
|
|
5
|
+
type MicrosoftOpenTelemetryLogger = {
|
|
6
|
+
info(message: string, ...args: unknown[]): void;
|
|
7
|
+
warn(message: string, ...args: unknown[]): void;
|
|
8
|
+
error(message: string, ...args: unknown[]): void;
|
|
9
|
+
};
|
|
10
|
+
type SpanAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
11
|
+
|
|
12
|
+
type MicrosoftOpenTelemetryTracingConfigOptions = {
|
|
13
|
+
agentId?: string;
|
|
14
|
+
agentDescription?: string;
|
|
15
|
+
agentVersion?: string;
|
|
16
|
+
recordInputs?: boolean;
|
|
17
|
+
recordOutputs?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Agent 365 defaults this to false because AI SDK v7 GenAI telemetry emits
|
|
20
|
+
* standard tool spans for streamText tool execution.
|
|
21
|
+
*/
|
|
22
|
+
emitToolSpans?: boolean;
|
|
23
|
+
tenantId?: string;
|
|
24
|
+
useGenAIOpenTelemetry?: boolean;
|
|
25
|
+
telemetryIntegrations?: TelemetryOptions["integrations"];
|
|
26
|
+
useGlobalTelemetryIntegrations?: boolean;
|
|
27
|
+
spanAttributes?: Record<string, SpanAttributeValue>;
|
|
28
|
+
};
|
|
29
|
+
type MicrosoftOpenTelemetryTracingConfig = {
|
|
30
|
+
agentId?: string;
|
|
31
|
+
agentDescription?: string;
|
|
32
|
+
agentVersion?: string;
|
|
33
|
+
recordInputs?: boolean;
|
|
34
|
+
recordOutputs?: boolean;
|
|
35
|
+
emitToolSpans?: boolean;
|
|
36
|
+
useGenAIOpenTelemetry?: boolean;
|
|
37
|
+
telemetryIntegrations?: TelemetryOptions["integrations"];
|
|
38
|
+
useGlobalTelemetryIntegrations?: boolean;
|
|
39
|
+
spanAttributes?: Record<string, SpanAttributeValue>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type MicrosoftOpenTelemetryResourceOptions = {
|
|
43
|
+
serviceName?: string;
|
|
44
|
+
serviceVersion?: string;
|
|
45
|
+
serviceNamespace?: string;
|
|
46
|
+
serviceInstanceId?: string;
|
|
47
|
+
attributes?: Record<string, string | number | boolean>;
|
|
48
|
+
};
|
|
49
|
+
type MicrosoftOpenTelemetryAzureMonitorOptions = {
|
|
50
|
+
enabled?: boolean;
|
|
51
|
+
azureMonitorExporterOptions?: Record<string, unknown>;
|
|
52
|
+
enableLiveMetrics?: boolean;
|
|
53
|
+
enableStandardMetrics?: boolean;
|
|
54
|
+
enableTraceBasedSamplingForLogs?: boolean;
|
|
55
|
+
enablePerformanceCounters?: boolean;
|
|
56
|
+
browserSdkLoaderOptions?: {
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
connectionString?: string;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
type MicrosoftOpenTelemetryInstrumentationConfig = {
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
type MicrosoftOpenAIAgentsInstrumentationOptions = MicrosoftOpenTelemetryInstrumentationConfig & {
|
|
67
|
+
tracerName?: string;
|
|
68
|
+
tracerVersion?: string;
|
|
69
|
+
isContentRecordingEnabled?: boolean;
|
|
70
|
+
suppressInvokeAgentInput?: boolean;
|
|
71
|
+
};
|
|
72
|
+
type MicrosoftLangChainInstrumentationOptions = MicrosoftOpenTelemetryInstrumentationConfig & {
|
|
73
|
+
isContentRecordingEnabled?: boolean;
|
|
74
|
+
};
|
|
75
|
+
type MicrosoftOpenTelemetryInstrumentationProfile = "agent-core" | "microsoft-genai" | "full-stack" | "manual" | "microsoft-default"
|
|
76
|
+
/**
|
|
77
|
+
* @deprecated Use `microsoft-genai`. This alias is kept for pre-release
|
|
78
|
+
* compatibility with early adapter builds.
|
|
79
|
+
*/
|
|
80
|
+
| "agent365-genai";
|
|
81
|
+
type MicrosoftOpenTelemetryInstrumentationOptions = {
|
|
82
|
+
azureSdk?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
83
|
+
http?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
84
|
+
mongoDb?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
85
|
+
mySql?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
86
|
+
postgreSql?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
87
|
+
redis?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
88
|
+
redis4?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
89
|
+
bunyan?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
90
|
+
winston?: MicrosoftOpenTelemetryInstrumentationConfig;
|
|
91
|
+
openaiAgents?: MicrosoftOpenAIAgentsInstrumentationOptions;
|
|
92
|
+
langchain?: MicrosoftLangChainInstrumentationOptions;
|
|
93
|
+
/**
|
|
94
|
+
* Forward-compatible pass-through for Microsoft distro instrumentation keys
|
|
95
|
+
* that this adapter has not named yet.
|
|
96
|
+
*/
|
|
97
|
+
[instrumentationName: string]: MicrosoftOpenTelemetryInstrumentationConfig | undefined;
|
|
98
|
+
};
|
|
99
|
+
type MicrosoftOpenTelemetryEnvironment = Record<string, string | undefined>;
|
|
100
|
+
type MicrosoftOpenTelemetryDestinationSummary = {
|
|
101
|
+
agent365: boolean;
|
|
102
|
+
azureMonitor: boolean;
|
|
103
|
+
otlp: boolean;
|
|
104
|
+
console: boolean;
|
|
105
|
+
};
|
|
106
|
+
type MicrosoftOpenTelemetryOptions = {
|
|
107
|
+
resource?: MicrosoftOpenTelemetryResourceOptions;
|
|
108
|
+
a365?: MicrosoftOpenTelemetryA365Options;
|
|
109
|
+
azureMonitor?: MicrosoftOpenTelemetryAzureMonitorOptions | false;
|
|
110
|
+
/**
|
|
111
|
+
* Opinionated instrumentation profile for Microsoft-backed agent services.
|
|
112
|
+
*
|
|
113
|
+
* Defaults to `agent-core`, which keeps Microsoft exporters/processors active
|
|
114
|
+
* while disabling Microsoft framework auto-instrumentations that are not part
|
|
115
|
+
* of the normal `@cuylabs/agent-core` execution path.
|
|
116
|
+
*
|
|
117
|
+
* Use `instrumentationOptions` for explicit per-library overrides.
|
|
118
|
+
*/
|
|
119
|
+
instrumentationProfile?: MicrosoftOpenTelemetryInstrumentationProfile;
|
|
120
|
+
instrumentationOptions?: MicrosoftOpenTelemetryInstrumentationOptions;
|
|
121
|
+
samplingRatio?: number;
|
|
122
|
+
tracesPerSecond?: number;
|
|
123
|
+
enableConsoleExporters?: boolean;
|
|
124
|
+
spanProcessors?: unknown[];
|
|
125
|
+
logRecordProcessors?: unknown[];
|
|
126
|
+
metricReaders?: unknown[];
|
|
127
|
+
views?: unknown[];
|
|
128
|
+
agent?: MicrosoftOpenTelemetryTracingConfigOptions;
|
|
129
|
+
/**
|
|
130
|
+
* Escape hatch for Microsoft distro options this adapter does not model yet.
|
|
131
|
+
* Explicit adapter fields take precedence.
|
|
132
|
+
*/
|
|
133
|
+
distroOptions?: Record<string, unknown>;
|
|
134
|
+
runtime?: MicrosoftOpenTelemetryRuntimeOptions;
|
|
135
|
+
};
|
|
136
|
+
type MicrosoftOpenTelemetryHandle = {
|
|
137
|
+
tracing: MicrosoftOpenTelemetryTracingConfig;
|
|
138
|
+
shutdown(): Promise<void>;
|
|
139
|
+
};
|
|
140
|
+
type MicrosoftOpenTelemetryRuntimeOptions = {
|
|
141
|
+
getDistroModule?: () => MicrosoftOpenTelemetryDistroModule | Promise<MicrosoftOpenTelemetryDistroModule>;
|
|
142
|
+
getResourceModule?: () => MicrosoftOpenTelemetryResourceModule | Promise<MicrosoftOpenTelemetryResourceModule>;
|
|
143
|
+
};
|
|
144
|
+
type MicrosoftOpenTelemetryDistroModule = {
|
|
145
|
+
useMicrosoftOpenTelemetry(options?: Record<string, unknown>): void;
|
|
146
|
+
shutdownMicrosoftOpenTelemetry(): Promise<void>;
|
|
147
|
+
BaggageBuilder: new () => MicrosoftBaggageBuilderLike;
|
|
148
|
+
runWithExportToken?: <T>(token: string, fn: () => T) => T;
|
|
149
|
+
updateExportToken?: (token: string) => boolean;
|
|
150
|
+
configureA365Hosting?: (adapter: MicrosoftA365HostingAdapterLike, options?: MicrosoftA365HostingOptions) => unknown;
|
|
151
|
+
ObservabilityHostingManager?: new () => {
|
|
152
|
+
configure(adapter: MicrosoftA365HostingAdapterLike, options: MicrosoftA365HostingOptions): void;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
type MicrosoftOpenTelemetryResourceModule = {
|
|
156
|
+
resourceFromAttributes(attributes: Record<string, string | number | boolean>): unknown;
|
|
157
|
+
};
|
|
158
|
+
type MicrosoftBaggageBuilderLike = {
|
|
159
|
+
setPairs(pairs: Record<string, string> | Iterable<[string, string]>): MicrosoftBaggageBuilderLike;
|
|
160
|
+
build(): {
|
|
161
|
+
run<T>(fn: () => T): T;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
type MicrosoftOpenTelemetryA365Options = {
|
|
166
|
+
/**
|
|
167
|
+
* Enables the A365 baggage/span processor path in the Microsoft distro.
|
|
168
|
+
*
|
|
169
|
+
* Defaults to `true` when this object is supplied.
|
|
170
|
+
*/
|
|
171
|
+
enabled?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Enables the Agent 365 HTTP exporter. When false, A365 baggage still enriches
|
|
174
|
+
* spans for Azure Monitor, OTLP, or console exporters.
|
|
175
|
+
*/
|
|
176
|
+
enableObservabilityExporter?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Compatibility alias for `enableObservabilityExporter`.
|
|
179
|
+
*
|
|
180
|
+
* New code should prefer the official Microsoft distro option name.
|
|
181
|
+
*/
|
|
182
|
+
exporterEnabled?: boolean;
|
|
183
|
+
tokenResolver?: MicrosoftOpenTelemetryTokenResolver;
|
|
184
|
+
clusterCategory?: "local" | "dev" | "test" | "preprod" | "firstrelease" | "prod" | "gov" | "high" | "dod" | "mooncake" | "ex" | "rx" | (string & {});
|
|
185
|
+
domainOverride?: string;
|
|
186
|
+
authScopes?: string[];
|
|
187
|
+
observabilityScopeOverride?: string;
|
|
188
|
+
logLevel?: string;
|
|
189
|
+
useS2SEndpoint?: boolean;
|
|
190
|
+
maxQueueSize?: number;
|
|
191
|
+
scheduledDelayMilliseconds?: number;
|
|
192
|
+
exporterTimeoutMilliseconds?: number;
|
|
193
|
+
httpRequestTimeoutMilliseconds?: number;
|
|
194
|
+
maxExportBatchSize?: number;
|
|
195
|
+
maxPayloadBytes?: number;
|
|
196
|
+
};
|
|
197
|
+
type MicrosoftA365HostingAdapterLike = {
|
|
198
|
+
use(middleware: unknown): void;
|
|
199
|
+
};
|
|
200
|
+
type MicrosoftA365HostingOptions = {
|
|
201
|
+
/**
|
|
202
|
+
* Registers Microsoft's baggage middleware for TurnContext-style adapters.
|
|
203
|
+
*
|
|
204
|
+
* Defaults to true in Microsoft's `configureA365Hosting()` helper.
|
|
205
|
+
*/
|
|
206
|
+
enableBaggage?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Registers Microsoft's output logging middleware.
|
|
209
|
+
*
|
|
210
|
+
* This can record outgoing message content on spans. Keep this setting
|
|
211
|
+
* explicit for applications with strict content-handling requirements.
|
|
212
|
+
*/
|
|
213
|
+
enableOutputLogging?: boolean;
|
|
214
|
+
};
|
|
215
|
+
type MicrosoftA365HostingConfigurationOptions = MicrosoftA365HostingOptions & {
|
|
216
|
+
runtime?: MicrosoftOpenTelemetryRuntimeOptions;
|
|
217
|
+
};
|
|
218
|
+
type MicrosoftA365RequestContext = {
|
|
219
|
+
tenantId?: string;
|
|
220
|
+
agentId?: string;
|
|
221
|
+
agentName?: string;
|
|
222
|
+
agentDescription?: string;
|
|
223
|
+
agentVersion?: string;
|
|
224
|
+
agentPlatformId?: string;
|
|
225
|
+
agentAuid?: string;
|
|
226
|
+
agentEmail?: string;
|
|
227
|
+
agentBlueprintId?: string;
|
|
228
|
+
sessionId?: string;
|
|
229
|
+
sessionDescription?: string;
|
|
230
|
+
conversationId?: string;
|
|
231
|
+
conversationItemLink?: string;
|
|
232
|
+
channelName?: string;
|
|
233
|
+
channelLink?: string;
|
|
234
|
+
userId?: string;
|
|
235
|
+
userName?: string;
|
|
236
|
+
userEmail?: string;
|
|
237
|
+
callerClientIp?: string;
|
|
238
|
+
callerAgentId?: string;
|
|
239
|
+
callerAgentName?: string;
|
|
240
|
+
callerAgentAuid?: string;
|
|
241
|
+
callerAgentEmail?: string;
|
|
242
|
+
callerAgentBlueprintId?: string;
|
|
243
|
+
callerAgentPlatformId?: string;
|
|
244
|
+
callerAgentVersion?: string;
|
|
245
|
+
serviceName?: string;
|
|
246
|
+
serverAddress?: string;
|
|
247
|
+
serverPort?: number;
|
|
248
|
+
exportToken?: string;
|
|
249
|
+
extraBaggage?: Record<string, string | number | boolean | null | undefined>;
|
|
250
|
+
};
|
|
251
|
+
type MicrosoftA365ActivityAccountLike = {
|
|
252
|
+
id?: string;
|
|
253
|
+
name?: string;
|
|
254
|
+
role?: string;
|
|
255
|
+
aadObjectId?: string;
|
|
256
|
+
agenticAppId?: string;
|
|
257
|
+
agenticAppBlueprintId?: string;
|
|
258
|
+
agenticUserId?: string;
|
|
259
|
+
tenantId?: string;
|
|
260
|
+
userPrincipalName?: string;
|
|
261
|
+
email?: string;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
type MicrosoftA365ActivityLike = {
|
|
265
|
+
id?: string;
|
|
266
|
+
text?: string;
|
|
267
|
+
serviceUrl?: string;
|
|
268
|
+
channelId?: string;
|
|
269
|
+
channelIdSubChannel?: string;
|
|
270
|
+
from?: MicrosoftA365ActivityAccountLike;
|
|
271
|
+
recipient?: MicrosoftA365ActivityAccountLike;
|
|
272
|
+
conversation?: {
|
|
273
|
+
id?: string;
|
|
274
|
+
name?: string;
|
|
275
|
+
tenantId?: string;
|
|
276
|
+
conversationType?: string;
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
};
|
|
279
|
+
channelData?: unknown;
|
|
280
|
+
isAgenticRequest?: () => boolean;
|
|
281
|
+
getAgenticInstanceId?: () => string | undefined;
|
|
282
|
+
getAgenticTenantId?: () => string | undefined;
|
|
283
|
+
[key: string]: unknown;
|
|
284
|
+
};
|
|
285
|
+
type MicrosoftA365TurnContextLike = {
|
|
286
|
+
activity?: MicrosoftA365ActivityLike;
|
|
287
|
+
identity?: Record<string, unknown>;
|
|
288
|
+
[key: string]: unknown;
|
|
289
|
+
};
|
|
290
|
+
type MicrosoftA365TurnContextOptions = Omit<MicrosoftA365RequestContext, "extraBaggage"> & {
|
|
291
|
+
serviceUrl?: string;
|
|
292
|
+
useRecipientIdAsAgentId?: boolean;
|
|
293
|
+
extraBaggage?: Record<string, string | number | boolean | null | undefined>;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
declare class MicrosoftOpenTelemetryModuleLoadError extends Error {
|
|
297
|
+
constructor(message: string, options?: ErrorOptions);
|
|
298
|
+
}
|
|
299
|
+
declare class MicrosoftOpenTelemetryResourceModuleLoadError extends Error {
|
|
300
|
+
constructor(message: string, options?: ErrorOptions);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
type MicrosoftManagedIdentityAssertionProvider = () => string | Promise<string>;
|
|
304
|
+
type MicrosoftA365S2STokenResolverLogger = Pick<MicrosoftOpenTelemetryLogger, "warn">;
|
|
305
|
+
type MicrosoftA365S2STokenResolverOptions = {
|
|
306
|
+
tenantId: string;
|
|
307
|
+
agentId: string;
|
|
308
|
+
blueprintClientId: string;
|
|
309
|
+
blueprintClientSecret?: string;
|
|
310
|
+
useManagedIdentity?: boolean;
|
|
311
|
+
managedIdentityAssertionProvider?: MicrosoftManagedIdentityAssertionProvider;
|
|
312
|
+
allowManagedIdentityClientSecretFallback?: boolean;
|
|
313
|
+
observabilityScope?: string;
|
|
314
|
+
fmiScope?: string;
|
|
315
|
+
refreshSkewMs?: number;
|
|
316
|
+
logger?: MicrosoftA365S2STokenResolverLogger;
|
|
317
|
+
fetch?: typeof fetch;
|
|
318
|
+
};
|
|
319
|
+
type MicrosoftA365S2STokenResolver = MicrosoftOpenTelemetryTokenResolver;
|
|
320
|
+
|
|
321
|
+
type MicrosoftOpenTelemetryResolvedEnvironment = {
|
|
322
|
+
resource: MicrosoftOpenTelemetryResourceOptions;
|
|
323
|
+
a365: MicrosoftOpenTelemetryA365Options;
|
|
324
|
+
instrumentationProfile?: MicrosoftOpenTelemetryInstrumentationProfile;
|
|
325
|
+
azureMonitorEnabled?: boolean;
|
|
326
|
+
enableConsoleExporters?: boolean;
|
|
327
|
+
};
|
|
328
|
+
type MicrosoftA365S2STokenResolverFromEnvOptions = Partial<Omit<MicrosoftA365S2STokenResolverOptions, "tenantId" | "agentId" | "blueprintClientId">> & Partial<Pick<MicrosoftA365S2STokenResolverOptions, "tenantId" | "agentId" | "blueprintClientId">> & {
|
|
329
|
+
env?: MicrosoftOpenTelemetryEnvironment;
|
|
330
|
+
};
|
|
331
|
+
declare function resolveMicrosoftOpenTelemetryEnvironment(env?: MicrosoftOpenTelemetryEnvironment): MicrosoftOpenTelemetryResolvedEnvironment;
|
|
332
|
+
declare function createMicrosoftA365S2STokenResolverFromEnv(options?: MicrosoftA365S2STokenResolverFromEnvOptions): MicrosoftOpenTelemetryTokenResolver;
|
|
333
|
+
declare function createEnvReader(env: MicrosoftOpenTelemetryEnvironment): (...names: string[]) => string | undefined;
|
|
334
|
+
|
|
335
|
+
declare const MICROSOFT_A365_FMI_SCOPE = "api://AzureADTokenExchange/.default";
|
|
336
|
+
declare const MICROSOFT_A365_OBSERVABILITY_SCOPE = "api://9b975845-388f-4429-889e-eab1ef63949c/.default";
|
|
337
|
+
/**
|
|
338
|
+
* Creates a token resolver for Agent 365 S2S observability export.
|
|
339
|
+
*
|
|
340
|
+
* The resolver follows the Agent 365 three-hop FMI flow:
|
|
341
|
+
* blueprint credential or managed-identity assertion -> FMI token targeted at
|
|
342
|
+
* the agent identity -> agent identity client assertion -> Observability token.
|
|
343
|
+
*/
|
|
344
|
+
declare function createMicrosoftA365S2STokenResolver(options: MicrosoftA365S2STokenResolverOptions): MicrosoftOpenTelemetryTokenResolver;
|
|
345
|
+
|
|
346
|
+
declare const MICROSOFT_A365_ATTRIBUTES: {
|
|
347
|
+
readonly tenantId: "microsoft.tenant.id";
|
|
348
|
+
readonly agentId: "gen_ai.agent.id";
|
|
349
|
+
readonly agentName: "gen_ai.agent.name";
|
|
350
|
+
readonly agentDescription: "gen_ai.agent.description";
|
|
351
|
+
readonly agentVersion: "gen_ai.agent.version";
|
|
352
|
+
readonly agentPlatformId: "microsoft.a365.agent.platform.id";
|
|
353
|
+
readonly agentAuid: "microsoft.agent.user.id";
|
|
354
|
+
readonly agentEmail: "microsoft.agent.user.email";
|
|
355
|
+
readonly agentBlueprintId: "microsoft.a365.agent.blueprint.id";
|
|
356
|
+
readonly sessionId: "microsoft.session.id";
|
|
357
|
+
readonly sessionDescription: "microsoft.session.description";
|
|
358
|
+
readonly conversationId: "gen_ai.conversation.id";
|
|
359
|
+
readonly conversationItemLink: "microsoft.conversation.item.link";
|
|
360
|
+
readonly channelName: "microsoft.channel.name";
|
|
361
|
+
readonly channelLink: "microsoft.channel.link";
|
|
362
|
+
readonly userId: "user.id";
|
|
363
|
+
readonly userName: "user.name";
|
|
364
|
+
readonly userEmail: "user.email";
|
|
365
|
+
readonly callerClientIp: "client.address";
|
|
366
|
+
readonly callerAgentId: "microsoft.a365.caller.agent.id";
|
|
367
|
+
readonly callerAgentName: "microsoft.a365.caller.agent.name";
|
|
368
|
+
readonly callerAgentAuid: "microsoft.a365.caller.agent.user.id";
|
|
369
|
+
readonly callerAgentEmail: "microsoft.a365.caller.agent.user.email";
|
|
370
|
+
readonly callerAgentBlueprintId: "microsoft.a365.caller.agent.blueprint.id";
|
|
371
|
+
readonly callerAgentPlatformId: "microsoft.a365.caller.agent.platform.id";
|
|
372
|
+
readonly callerAgentVersion: "microsoft.a365.caller.agent.version";
|
|
373
|
+
readonly serviceName: "service.name";
|
|
374
|
+
readonly serverAddress: "server.address";
|
|
375
|
+
readonly serverPort: "server.port";
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
declare function buildMicrosoftA365BaggagePairs(context: MicrosoftA365RequestContext): Record<string, string>;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Registers Microsoft's A365 hosting middleware on a TurnContext-style adapter.
|
|
382
|
+
*
|
|
383
|
+
* Use this only for apps built on Microsoft Agent Hosting compatible adapters.
|
|
384
|
+
* Channel adapters that do not use that middleware shape should wrap their turn
|
|
385
|
+
* source with `createMicrosoftA365ObservedTurnSource()` instead.
|
|
386
|
+
*/
|
|
387
|
+
declare function configureMicrosoftA365Hosting(adapter: MicrosoftA365HostingAdapterLike, options?: MicrosoftA365HostingConfigurationOptions): Promise<unknown>;
|
|
388
|
+
|
|
389
|
+
declare function createMicrosoftA365ContextFromTurnContext(turnContext: MicrosoftA365TurnContextLike, options?: MicrosoftA365TurnContextOptions): MicrosoftA365RequestContext;
|
|
390
|
+
|
|
391
|
+
type MicrosoftA365ObservedTurnSourceContextInput = {
|
|
392
|
+
sessionId: string;
|
|
393
|
+
message: string;
|
|
394
|
+
options?: AgentTurnSourceChatOptions;
|
|
395
|
+
};
|
|
396
|
+
type MicrosoftA365ObservedTurnSourceContextFactory = (input: MicrosoftA365ObservedTurnSourceContextInput) => MicrosoftA365RequestContext | Promise<MicrosoftA365RequestContext>;
|
|
397
|
+
type MicrosoftA365ObservedTurnSourceOptions = {
|
|
398
|
+
source: AgentTurnSource;
|
|
399
|
+
context: MicrosoftA365RequestContext | MicrosoftA365ObservedTurnSourceContextFactory;
|
|
400
|
+
runtimeOptions?: MicrosoftOpenTelemetryRuntimeOptions;
|
|
401
|
+
};
|
|
402
|
+
declare function createMicrosoftA365ObservedTurnSource({ context, runtimeOptions, source, }: MicrosoftA365ObservedTurnSourceOptions): AgentTurnSource;
|
|
403
|
+
|
|
404
|
+
declare function isMicrosoftOtlpEnvironmentEnabled(env?: MicrosoftOpenTelemetryEnvironment): boolean;
|
|
405
|
+
declare function isAzureMonitorEnvironmentEnabled(env?: MicrosoftOpenTelemetryEnvironment): boolean;
|
|
406
|
+
declare function createAzureMonitorOptionsFromEnv(env?: MicrosoftOpenTelemetryEnvironment): MicrosoftOpenTelemetryAzureMonitorOptions | undefined;
|
|
407
|
+
declare function summarizeMicrosoftOpenTelemetryDestinations(options?: {
|
|
408
|
+
azureMonitor?: MicrosoftOpenTelemetryAzureMonitorOptions | false;
|
|
409
|
+
a365?: {
|
|
410
|
+
enabled?: boolean;
|
|
411
|
+
enableObservabilityExporter?: boolean;
|
|
412
|
+
};
|
|
413
|
+
enableConsoleExporters?: boolean;
|
|
414
|
+
env?: MicrosoftOpenTelemetryEnvironment;
|
|
415
|
+
}): MicrosoftOpenTelemetryDestinationSummary;
|
|
416
|
+
|
|
417
|
+
declare function createMicrosoftOpenTelemetryInstrumentationOptions(options?: {
|
|
418
|
+
profile?: MicrosoftOpenTelemetryInstrumentationProfile;
|
|
419
|
+
overrides?: MicrosoftOpenTelemetryInstrumentationOptions;
|
|
420
|
+
}): MicrosoftOpenTelemetryInstrumentationOptions;
|
|
421
|
+
declare function normalizeInstrumentationProfile(profile: MicrosoftOpenTelemetryInstrumentationProfile | undefined): MicrosoftOpenTelemetryInstrumentationProfile;
|
|
422
|
+
declare function mergeInstrumentationOptions(base: MicrosoftOpenTelemetryInstrumentationOptions | undefined, overrides: MicrosoftOpenTelemetryInstrumentationOptions | undefined): MicrosoftOpenTelemetryInstrumentationOptions;
|
|
423
|
+
|
|
424
|
+
declare function initMicrosoftOpenTelemetry(options?: MicrosoftOpenTelemetryOptions): Promise<MicrosoftOpenTelemetryHandle>;
|
|
425
|
+
declare function initMicrosoftOpenTelemetryFromEnv(options?: Omit<MicrosoftOpenTelemetryOptions, "resource" | "a365" | "azureMonitor"> & {
|
|
426
|
+
env?: NodeJS.ProcessEnv;
|
|
427
|
+
resource?: Partial<MicrosoftOpenTelemetryResourceOptions>;
|
|
428
|
+
a365?: Partial<MicrosoftOpenTelemetryA365Options>;
|
|
429
|
+
}): Promise<MicrosoftOpenTelemetryHandle>;
|
|
430
|
+
declare function runWithMicrosoftA365Context<T>(requestContext: MicrosoftA365RequestContext, fn: () => T, options?: MicrosoftOpenTelemetryRuntimeOptions): Promise<Awaited<T>>;
|
|
431
|
+
declare function updateMicrosoftA365ExportToken(token: string, options?: MicrosoftOpenTelemetryRuntimeOptions): Promise<boolean>;
|
|
432
|
+
declare function resolveMicrosoftOpenTelemetryBooleanEnv(value: string | undefined): boolean | undefined;
|
|
433
|
+
declare function resolveMicrosoftOpenTelemetryNumberEnv(value: string | undefined): number | undefined;
|
|
434
|
+
|
|
435
|
+
declare function loadMicrosoftOpenTelemetryModule(options?: MicrosoftOpenTelemetryRuntimeOptions): Promise<MicrosoftOpenTelemetryDistroModule>;
|
|
436
|
+
declare function loadOpenTelemetryResourceModule(options?: MicrosoftOpenTelemetryRuntimeOptions): Promise<MicrosoftOpenTelemetryResourceModule>;
|
|
437
|
+
|
|
438
|
+
declare function createMicrosoftOpenTelemetryTracingConfig(options?: MicrosoftOpenTelemetryTracingConfigOptions): MicrosoftOpenTelemetryTracingConfig;
|
|
439
|
+
|
|
440
|
+
export { MICROSOFT_A365_ATTRIBUTES, MICROSOFT_A365_FMI_SCOPE, MICROSOFT_A365_OBSERVABILITY_SCOPE, type MicrosoftA365ActivityAccountLike, type MicrosoftA365ActivityLike, type MicrosoftA365HostingAdapterLike, type MicrosoftA365HostingConfigurationOptions, type MicrosoftA365HostingOptions, type MicrosoftA365ObservedTurnSourceContextFactory, type MicrosoftA365ObservedTurnSourceContextInput, type MicrosoftA365ObservedTurnSourceOptions, type MicrosoftA365RequestContext, type MicrosoftA365S2STokenResolver, type MicrosoftA365S2STokenResolverFromEnvOptions, type MicrosoftA365S2STokenResolverLogger, type MicrosoftA365S2STokenResolverOptions, type MicrosoftA365TurnContextLike, type MicrosoftA365TurnContextOptions, type MicrosoftBaggageBuilderLike, type MicrosoftLangChainInstrumentationOptions, type MicrosoftManagedIdentityAssertionProvider, type MicrosoftOpenAIAgentsInstrumentationOptions, type MicrosoftOpenTelemetryA365Options, type MicrosoftOpenTelemetryAzureMonitorOptions, type MicrosoftOpenTelemetryDestinationSummary, type MicrosoftOpenTelemetryDistroModule, type MicrosoftOpenTelemetryEnvironment, type MicrosoftOpenTelemetryHandle, type MicrosoftOpenTelemetryInstrumentationConfig, type MicrosoftOpenTelemetryInstrumentationOptions, type MicrosoftOpenTelemetryInstrumentationProfile, type MicrosoftOpenTelemetryLogger, MicrosoftOpenTelemetryModuleLoadError, type MicrosoftOpenTelemetryOptions, type MicrosoftOpenTelemetryResolvedEnvironment, type MicrosoftOpenTelemetryResourceModule, MicrosoftOpenTelemetryResourceModuleLoadError, type MicrosoftOpenTelemetryResourceOptions, type MicrosoftOpenTelemetryRuntimeOptions, type MicrosoftOpenTelemetryTokenResolver, type MicrosoftOpenTelemetryTracingConfig, type MicrosoftOpenTelemetryTracingConfigOptions, type SpanAttributeValue, buildMicrosoftA365BaggagePairs, configureMicrosoftA365Hosting, createAzureMonitorOptionsFromEnv, createEnvReader, createMicrosoftA365ContextFromTurnContext, createMicrosoftA365ObservedTurnSource, createMicrosoftA365S2STokenResolver, createMicrosoftA365S2STokenResolverFromEnv, createMicrosoftOpenTelemetryInstrumentationOptions, createMicrosoftOpenTelemetryTracingConfig, initMicrosoftOpenTelemetry, initMicrosoftOpenTelemetryFromEnv, isAzureMonitorEnvironmentEnabled, isMicrosoftOtlpEnvironmentEnabled, loadMicrosoftOpenTelemetryModule, loadOpenTelemetryResourceModule, mergeInstrumentationOptions, normalizeInstrumentationProfile, resolveMicrosoftOpenTelemetryBooleanEnv, resolveMicrosoftOpenTelemetryEnvironment, resolveMicrosoftOpenTelemetryNumberEnv, runWithMicrosoftA365Context, summarizeMicrosoftOpenTelemetryDestinations, updateMicrosoftA365ExportToken };
|