@microsoft/agents-a365-observability 0.1.0-preview.30

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.
Files changed (130) hide show
  1. package/README.md +33 -0
  2. package/dist/cjs/ObservabilityBuilder.d.ts +61 -0
  3. package/dist/cjs/ObservabilityBuilder.d.ts.map +1 -0
  4. package/dist/cjs/ObservabilityBuilder.js +141 -0
  5. package/dist/cjs/ObservabilityBuilder.js.map +1 -0
  6. package/dist/cjs/ObservabilityManager.d.ts +29 -0
  7. package/dist/cjs/ObservabilityManager.d.ts.map +1 -0
  8. package/dist/cjs/ObservabilityManager.js +61 -0
  9. package/dist/cjs/ObservabilityManager.js.map +1 -0
  10. package/dist/cjs/index.d.ts +10 -0
  11. package/dist/cjs/index.d.ts.map +1 -0
  12. package/dist/cjs/index.js +33 -0
  13. package/dist/cjs/index.js.map +1 -0
  14. package/dist/cjs/tracing/constants.d.ts +83 -0
  15. package/dist/cjs/tracing/constants.d.ts.map +1 -0
  16. package/dist/cjs/tracing/constants.js +101 -0
  17. package/dist/cjs/tracing/constants.js.map +1 -0
  18. package/dist/cjs/tracing/contracts.d.ts +186 -0
  19. package/dist/cjs/tracing/contracts.d.ts.map +1 -0
  20. package/dist/cjs/tracing/contracts.js +44 -0
  21. package/dist/cjs/tracing/contracts.js.map +1 -0
  22. package/dist/cjs/tracing/exporter/Agent365Exporter.d.ts +53 -0
  23. package/dist/cjs/tracing/exporter/Agent365Exporter.d.ts.map +1 -0
  24. package/dist/cjs/tracing/exporter/Agent365Exporter.js +318 -0
  25. package/dist/cjs/tracing/exporter/Agent365Exporter.js.map +1 -0
  26. package/dist/cjs/tracing/exporter/utils.d.ts +38 -0
  27. package/dist/cjs/tracing/exporter/utils.d.ts.map +1 -0
  28. package/dist/cjs/tracing/exporter/utils.js +126 -0
  29. package/dist/cjs/tracing/exporter/utils.js.map +1 -0
  30. package/dist/cjs/tracing/middleware/BaggageBuilder.d.ts +182 -0
  31. package/dist/cjs/tracing/middleware/BaggageBuilder.d.ts.map +1 -0
  32. package/dist/cjs/tracing/middleware/BaggageBuilder.js +297 -0
  33. package/dist/cjs/tracing/middleware/BaggageBuilder.js.map +1 -0
  34. package/dist/cjs/tracing/processors/SpanProcessor.d.ts +30 -0
  35. package/dist/cjs/tracing/processors/SpanProcessor.d.ts.map +1 -0
  36. package/dist/cjs/tracing/processors/SpanProcessor.js +98 -0
  37. package/dist/cjs/tracing/processors/SpanProcessor.js.map +1 -0
  38. package/dist/cjs/tracing/processors/util.d.ts +9 -0
  39. package/dist/cjs/tracing/processors/util.d.ts.map +1 -0
  40. package/dist/cjs/tracing/processors/util.js +50 -0
  41. package/dist/cjs/tracing/processors/util.js.map +1 -0
  42. package/dist/cjs/tracing/scopes/ExecuteToolScope.d.ts +22 -0
  43. package/dist/cjs/tracing/scopes/ExecuteToolScope.d.ts.map +1 -0
  44. package/dist/cjs/tracing/scopes/ExecuteToolScope.js +51 -0
  45. package/dist/cjs/tracing/scopes/ExecuteToolScope.js.map +1 -0
  46. package/dist/cjs/tracing/scopes/InferenceScope.d.ts +47 -0
  47. package/dist/cjs/tracing/scopes/InferenceScope.d.ts.map +1 -0
  48. package/dist/cjs/tracing/scopes/InferenceScope.js +83 -0
  49. package/dist/cjs/tracing/scopes/InferenceScope.js.map +1 -0
  50. package/dist/cjs/tracing/scopes/InvokeAgentScope.d.ts +33 -0
  51. package/dist/cjs/tracing/scopes/InvokeAgentScope.d.ts.map +1 -0
  52. package/dist/cjs/tracing/scopes/InvokeAgentScope.js +94 -0
  53. package/dist/cjs/tracing/scopes/InvokeAgentScope.js.map +1 -0
  54. package/dist/cjs/tracing/scopes/OpenTelemetryScope.d.ts +57 -0
  55. package/dist/cjs/tracing/scopes/OpenTelemetryScope.d.ts.map +1 -0
  56. package/dist/cjs/tracing/scopes/OpenTelemetryScope.js +146 -0
  57. package/dist/cjs/tracing/scopes/OpenTelemetryScope.js.map +1 -0
  58. package/dist/cjs/tracing/util.d.ts +9 -0
  59. package/dist/cjs/tracing/util.d.ts.map +1 -0
  60. package/dist/cjs/tracing/util.js +28 -0
  61. package/dist/cjs/tracing/util.js.map +1 -0
  62. package/dist/cjs/utils/logging.d.ts +11 -0
  63. package/dist/cjs/utils/logging.d.ts.map +1 -0
  64. package/dist/cjs/utils/logging.js +84 -0
  65. package/dist/cjs/utils/logging.js.map +1 -0
  66. package/dist/esm/ObservabilityBuilder.d.ts +61 -0
  67. package/dist/esm/ObservabilityBuilder.d.ts.map +1 -0
  68. package/dist/esm/ObservabilityBuilder.js +137 -0
  69. package/dist/esm/ObservabilityBuilder.js.map +1 -0
  70. package/dist/esm/ObservabilityManager.d.ts +29 -0
  71. package/dist/esm/ObservabilityManager.d.ts.map +1 -0
  72. package/dist/esm/ObservabilityManager.js +57 -0
  73. package/dist/esm/ObservabilityManager.js.map +1 -0
  74. package/dist/esm/index.d.ts +10 -0
  75. package/dist/esm/index.d.ts.map +1 -0
  76. package/dist/esm/index.js +18 -0
  77. package/dist/esm/index.js.map +1 -0
  78. package/dist/esm/tracing/constants.d.ts +83 -0
  79. package/dist/esm/tracing/constants.d.ts.map +1 -0
  80. package/dist/esm/tracing/constants.js +97 -0
  81. package/dist/esm/tracing/constants.js.map +1 -0
  82. package/dist/esm/tracing/contracts.d.ts +186 -0
  83. package/dist/esm/tracing/contracts.d.ts.map +1 -0
  84. package/dist/esm/tracing/contracts.js +41 -0
  85. package/dist/esm/tracing/contracts.js.map +1 -0
  86. package/dist/esm/tracing/exporter/Agent365Exporter.d.ts +53 -0
  87. package/dist/esm/tracing/exporter/Agent365Exporter.d.ts.map +1 -0
  88. package/dist/esm/tracing/exporter/Agent365Exporter.js +281 -0
  89. package/dist/esm/tracing/exporter/Agent365Exporter.js.map +1 -0
  90. package/dist/esm/tracing/exporter/utils.d.ts +38 -0
  91. package/dist/esm/tracing/exporter/utils.d.ts.map +1 -0
  92. package/dist/esm/tracing/exporter/utils.js +113 -0
  93. package/dist/esm/tracing/exporter/utils.js.map +1 -0
  94. package/dist/esm/tracing/middleware/BaggageBuilder.d.ts +182 -0
  95. package/dist/esm/tracing/middleware/BaggageBuilder.d.ts.map +1 -0
  96. package/dist/esm/tracing/middleware/BaggageBuilder.js +292 -0
  97. package/dist/esm/tracing/middleware/BaggageBuilder.js.map +1 -0
  98. package/dist/esm/tracing/processors/SpanProcessor.d.ts +30 -0
  99. package/dist/esm/tracing/processors/SpanProcessor.d.ts.map +1 -0
  100. package/dist/esm/tracing/processors/SpanProcessor.js +94 -0
  101. package/dist/esm/tracing/processors/SpanProcessor.js.map +1 -0
  102. package/dist/esm/tracing/processors/util.d.ts +9 -0
  103. package/dist/esm/tracing/processors/util.d.ts.map +1 -0
  104. package/dist/esm/tracing/processors/util.js +47 -0
  105. package/dist/esm/tracing/processors/util.js.map +1 -0
  106. package/dist/esm/tracing/scopes/ExecuteToolScope.d.ts +22 -0
  107. package/dist/esm/tracing/scopes/ExecuteToolScope.d.ts.map +1 -0
  108. package/dist/esm/tracing/scopes/ExecuteToolScope.js +47 -0
  109. package/dist/esm/tracing/scopes/ExecuteToolScope.js.map +1 -0
  110. package/dist/esm/tracing/scopes/InferenceScope.d.ts +47 -0
  111. package/dist/esm/tracing/scopes/InferenceScope.d.ts.map +1 -0
  112. package/dist/esm/tracing/scopes/InferenceScope.js +79 -0
  113. package/dist/esm/tracing/scopes/InferenceScope.js.map +1 -0
  114. package/dist/esm/tracing/scopes/InvokeAgentScope.d.ts +33 -0
  115. package/dist/esm/tracing/scopes/InvokeAgentScope.d.ts.map +1 -0
  116. package/dist/esm/tracing/scopes/InvokeAgentScope.js +90 -0
  117. package/dist/esm/tracing/scopes/InvokeAgentScope.js.map +1 -0
  118. package/dist/esm/tracing/scopes/OpenTelemetryScope.d.ts +57 -0
  119. package/dist/esm/tracing/scopes/OpenTelemetryScope.d.ts.map +1 -0
  120. package/dist/esm/tracing/scopes/OpenTelemetryScope.js +139 -0
  121. package/dist/esm/tracing/scopes/OpenTelemetryScope.js.map +1 -0
  122. package/dist/esm/tracing/util.d.ts +9 -0
  123. package/dist/esm/tracing/util.d.ts.map +1 -0
  124. package/dist/esm/tracing/util.js +23 -0
  125. package/dist/esm/tracing/util.js.map +1 -0
  126. package/dist/esm/utils/logging.d.ts +11 -0
  127. package/dist/esm/utils/logging.d.ts.map +1 -0
  128. package/dist/esm/utils/logging.js +81 -0
  129. package/dist/esm/utils/logging.js.map +1 -0
  130. package/package.json +69 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;AAEjF,mBAAmB;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,IAAI,OAAO,EAAkB,MAAM,wBAAwB,CAAC;AAEzF,oBAAoB;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAEnF,2BAA2B;AAC3B,OAAO,EACL,aAAa,EACb,cAAc,EAWd,sBAAsB,EAEvB,MAAM,qBAAqB,CAAC;AAE7B,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAC,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * OpenTelemetry constants for Agent 365
3
+ */
4
+ export declare class OpenTelemetryConstants {
5
+ static readonly INVOKE_AGENT_OPERATION_NAME = "invoke_agent";
6
+ static readonly EXECUTE_TOOL_OPERATION_NAME = "execute_tool";
7
+ static readonly ERROR_TYPE_KEY = "error.type";
8
+ static readonly ERROR_MESSAGE_KEY = "error.message";
9
+ static readonly AZ_NAMESPACE_KEY = "az.namespace";
10
+ static readonly SERVER_ADDRESS_KEY = "server.address";
11
+ static readonly SERVER_PORT_KEY = "server.port";
12
+ static readonly AZURE_RP_NAMESPACE_VALUE = "Microsoft.CognitiveServices";
13
+ static readonly SOURCE_NAME = "Agent365Sdk";
14
+ static readonly ENABLE_OPENTELEMETRY_SWITCH = "Azure.Experimental.EnableActivitySource";
15
+ static readonly TRACE_CONTENTS_SWITCH = "Azure.Experimental.TraceGenAIMessageContent";
16
+ static readonly TRACE_CONTENTS_ENVIRONMENT_VARIABLE = "AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED";
17
+ static readonly ENABLE_OBSERVABILITY = "ENABLE_OBSERVABILITY";
18
+ static readonly ENABLE_A365_OBSERVABILITY_EXPORTER = "ENABLE_A365_OBSERVABILITY_EXPORTER";
19
+ static readonly ENABLE_A365_OBSERVABILITY = "ENABLE_A365_OBSERVABILITY";
20
+ static readonly GEN_AI_CLIENT_OPERATION_DURATION_METRIC_NAME = "gen_ai.client.operation.duration";
21
+ static readonly GEN_AI_CLIENT_TOKEN_USAGE_METRIC_NAME = "gen_ai.client.token.usage";
22
+ static readonly GEN_AI_OPERATION_NAME_KEY = "gen_ai.operation.name";
23
+ static readonly GEN_AI_REQUEST_MAX_TOKENS_KEY = "gen_ai.request.max_tokens";
24
+ static readonly GEN_AI_REQUEST_MODEL_KEY = "gen_ai.request.model";
25
+ static readonly GEN_AI_REQUEST_TEMPERATURE_KEY = "gen_ai.request.temperature";
26
+ static readonly GEN_AI_REQUEST_TOP_P_KEY = "gen_ai.request.top_p";
27
+ static readonly GEN_AI_RESPONSE_ID_KEY = "gen_ai.response.id";
28
+ static readonly GEN_AI_RESPONSE_FINISH_REASONS_KEY = "gen_ai.response.finish_reasons";
29
+ static readonly GEN_AI_RESPONSE_MODEL_KEY = "gen_ai.response.model";
30
+ static readonly GEN_AI_SYSTEM_KEY = "gen_ai.system";
31
+ static readonly GEN_AI_SYSTEM_VALUE = "az.ai.agent365";
32
+ static readonly GEN_AI_AGENT_ID_KEY = "gen_ai.agent.id";
33
+ static readonly GEN_AI_AGENT_NAME_KEY = "gen_ai.agent.name";
34
+ static readonly GEN_AI_AGENT_DESCRIPTION_KEY = "gen_ai.agent.description";
35
+ static readonly GEN_AI_CONVERSATION_ID_KEY = "gen_ai.conversation.id";
36
+ static readonly GEN_AI_CONVERSATION_ITEM_LINK_KEY = "gen_ai.conversation.item.link";
37
+ static readonly GEN_AI_TOKEN_TYPE_KEY = "gen_ai.token.type";
38
+ static readonly GEN_AI_USAGE_INPUT_TOKENS_KEY = "gen_ai.usage.input_tokens";
39
+ static readonly GEN_AI_USAGE_OUTPUT_TOKENS_KEY = "gen_ai.usage.output_tokens";
40
+ static readonly GEN_AI_CHOICE = "gen_ai.choice";
41
+ static readonly GEN_AI_PROVIDER_NAME_KEY = "gen_ai.provider.name";
42
+ static readonly GEN_AI_SYSTEM_INSTRUCTIONS_KEY = "gen_ai.system_instructions";
43
+ static readonly GEN_AI_INPUT_MESSAGES_KEY = "gen_ai.input.messages";
44
+ static readonly GEN_AI_OUTPUT_MESSAGES_KEY = "gen_ai.output.messages";
45
+ static readonly GEN_AI_EVENT_CONTENT = "gen_ai.event.content";
46
+ static readonly GEN_AI_TOOL_CALL_ID_KEY = "gen_ai.tool.call.id";
47
+ static readonly GEN_AI_TOOL_NAME_KEY = "gen_ai.tool.name";
48
+ static readonly GEN_AI_TOOL_DESCRIPTION_KEY = "gen_ai.tool.description";
49
+ static readonly GEN_AI_TOOL_ARGS_KEY = "gen_ai.tool.call.arguments";
50
+ static readonly GEN_AI_TOOL_CALL_RESULT_KEY = "gen_ai.event.content";
51
+ static readonly GEN_AI_TOOL_TYPE_KEY = "gen_ai.tool.type";
52
+ static readonly GEN_AI_AGENT_USER_ID_KEY = "gen_ai.agent.userid";
53
+ static readonly GEN_AI_CALLER_USER_ID_KEY = "gen_ai.caller.userid";
54
+ static readonly GEN_AI_CALLER_TENANT_ID_KEY = "gen_ai.caller.tenantid";
55
+ static readonly GEN_AI_CALLER_ID_KEY = "gen_ai.caller.id";
56
+ static readonly GEN_AI_CALLER_NAME_KEY = "gen_ai.caller.name";
57
+ static readonly GEN_AI_CALLER_UPN_KEY = "gen_ai.caller.upn";
58
+ static readonly GEN_AI_CALLER_AGENT_USER_ID_KEY = "gen_ai.caller.agent.userid";
59
+ static readonly GEN_AI_CALLER_AGENT_UPN_KEY = "gen_ai.caller.agent.upn";
60
+ static readonly GEN_AI_CALLER_AGENT_TENANT_ID_KEY = "gen_ai.caller.agent.tenantid";
61
+ static readonly GEN_AI_CALLER_AGENT_NAME_KEY = "gen_ai.caller.agent.name";
62
+ static readonly GEN_AI_CALLER_AGENT_ID_KEY = "gen_ai.caller.agent.id";
63
+ static readonly GEN_AI_CALLER_AGENT_APPLICATION_ID_KEY = "gen_ai.caller.agent.applicationid";
64
+ static readonly AGENT_ID_KEY = "gen_ai.agent.id";
65
+ static readonly GEN_AI_TASK_ID_KEY = "gen_ai.task.id";
66
+ static readonly SESSION_ID_KEY = "session.id";
67
+ static readonly GEN_AI_ICON_URI_KEY = "gen_ai.agent365.icon_uri";
68
+ static readonly TENANT_ID_KEY = "tenant.id";
69
+ static readonly OPERATION_SOURCE_KEY = "operation.source";
70
+ static readonly GEN_AI_AGENT_AUID_KEY = "gen_ai.agent.user.id";
71
+ static readonly GEN_AI_AGENT_UPN_KEY = "gen_ai.agent.upn";
72
+ static readonly GEN_AI_AGENT_BLUEPRINT_ID_KEY = "gen_ai.agent.applicationid";
73
+ static readonly CORRELATION_ID_KEY = "correlation.id";
74
+ static readonly HIRING_MANAGER_ID_KEY = "hiring.manager.id";
75
+ static readonly GEN_AI_EXECUTION_TYPE_KEY = "gen_ai.execution.type";
76
+ static readonly GEN_AI_EXECUTION_PAYLOAD_KEY = "gen_ai.execution.payload";
77
+ static readonly GEN_AI_EXECUTION_SOURCE_ID_KEY = "gen_ai.execution.sourceMetadata.id";
78
+ static readonly GEN_AI_EXECUTION_SOURCE_NAME_KEY = "gen_ai.channel.name";
79
+ static readonly GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY = "gen_ai.channel.link";
80
+ static readonly CUSTOM_PARENT_SPAN_ID_KEY = "custom.parent.span.id";
81
+ static readonly CUSTOM_SPAN_NAME_KEY = "custom.span.name";
82
+ }
83
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/tracing/constants.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,sBAAsB;IAEjC,gBAAuB,2BAA2B,kBAAkB;IACpE,gBAAuB,2BAA2B,kBAAkB;IAGpE,gBAAuB,cAAc,gBAAgB;IACrD,gBAAuB,iBAAiB,mBAAmB;IAC3D,gBAAuB,gBAAgB,kBAAkB;IACzD,gBAAuB,kBAAkB,oBAAoB;IAC7D,gBAAuB,eAAe,iBAAiB;IACvD,gBAAuB,wBAAwB,iCAAiC;IAChF,gBAAuB,WAAW,iBAAiB;IACnD,gBAAuB,2BAA2B,6CAA6C;IAC/F,gBAAuB,qBAAqB,iDAAiD;IAC7F,gBAAuB,mCAAmC,oDAAoD;IAC9G,gBAAuB,oBAAoB,0BAA0B;IACrE,gBAAuB,kCAAkC,wCAAwC;IACjG,gBAAuB,yBAAyB,+BAA+B;IAG/E,gBAAuB,4CAA4C,sCAAsC;IACzG,gBAAuB,qCAAqC,+BAA+B;IAC3F,gBAAuB,yBAAyB,2BAA2B;IAC3E,gBAAuB,6BAA6B,+BAA+B;IACnF,gBAAuB,wBAAwB,0BAA0B;IACzE,gBAAuB,8BAA8B,gCAAgC;IACrF,gBAAuB,wBAAwB,0BAA0B;IACzE,gBAAuB,sBAAsB,wBAAwB;IACrE,gBAAuB,kCAAkC,oCAAoC;IAC7F,gBAAuB,yBAAyB,2BAA2B;IAC3E,gBAAuB,iBAAiB,mBAAmB;IAC3D,gBAAuB,mBAAmB,oBAAo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0B;IACtE,gBAAuB,oBAAoB,sBAAsB;IACjE,gBAAuB,6BAA6B,gCAAgC;IACpF,gBAAuB,kBAAkB,oBAAoB;IAC7D,gBAAuB,qBAAqB,uBAAuB;IAGnE,gBAAuB,yBAAyB,2BAA2B;IAC3E,gBAAuB,4BAA4B,8BAA8B;IAGjF,gBAAuB,8BAA8B,wCAAwC;IAC7F,gBAAuB,gCAAgC,yBAAyB;IAChF,gBAAuB,uCAAuC,yBAAyB;IAGvF,gBAAuB,yBAAyB,2BAA2B;IAC3E,gBAAuB,oBAAoB,sBAAsB;CAClE"}
@@ -0,0 +1,97 @@
1
+ // ------------------------------------------------------------------------------
2
+ // Copyright (c) Microsoft Corporation. All rights reserved.
3
+ // ------------------------------------------------------------------------------
4
+ /**
5
+ * OpenTelemetry constants for Agent 365
6
+ */
7
+ export class OpenTelemetryConstants {
8
+ }
9
+ // Span operation names
10
+ OpenTelemetryConstants.INVOKE_AGENT_OPERATION_NAME = 'invoke_agent';
11
+ OpenTelemetryConstants.EXECUTE_TOOL_OPERATION_NAME = 'execute_tool';
12
+ // OpenTelemetry semantic conventions
13
+ OpenTelemetryConstants.ERROR_TYPE_KEY = 'error.type';
14
+ OpenTelemetryConstants.ERROR_MESSAGE_KEY = 'error.message';
15
+ OpenTelemetryConstants.AZ_NAMESPACE_KEY = 'az.namespace';
16
+ OpenTelemetryConstants.SERVER_ADDRESS_KEY = 'server.address';
17
+ OpenTelemetryConstants.SERVER_PORT_KEY = 'server.port';
18
+ OpenTelemetryConstants.AZURE_RP_NAMESPACE_VALUE = 'Microsoft.CognitiveServices';
19
+ OpenTelemetryConstants.SOURCE_NAME = 'Agent365Sdk';
20
+ OpenTelemetryConstants.ENABLE_OPENTELEMETRY_SWITCH = 'Azure.Experimental.EnableActivitySource';
21
+ OpenTelemetryConstants.TRACE_CONTENTS_SWITCH = 'Azure.Experimental.TraceGenAIMessageContent';
22
+ OpenTelemetryConstants.TRACE_CONTENTS_ENVIRONMENT_VARIABLE = 'AZURE_TRACING_GEN_AI_CONTENT_RECORDING_ENABLED';
23
+ OpenTelemetryConstants.ENABLE_OBSERVABILITY = 'ENABLE_OBSERVABILITY';
24
+ OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY_EXPORTER = 'ENABLE_A365_OBSERVABILITY_EXPORTER';
25
+ OpenTelemetryConstants.ENABLE_A365_OBSERVABILITY = 'ENABLE_A365_OBSERVABILITY';
26
+ // GenAI semantic conventions
27
+ OpenTelemetryConstants.GEN_AI_CLIENT_OPERATION_DURATION_METRIC_NAME = 'gen_ai.client.operation.duration';
28
+ OpenTelemetryConstants.GEN_AI_CLIENT_TOKEN_USAGE_METRIC_NAME = 'gen_ai.client.token.usage';
29
+ OpenTelemetryConstants.GEN_AI_OPERATION_NAME_KEY = 'gen_ai.operation.name';
30
+ OpenTelemetryConstants.GEN_AI_REQUEST_MAX_TOKENS_KEY = 'gen_ai.request.max_tokens';
31
+ OpenTelemetryConstants.GEN_AI_REQUEST_MODEL_KEY = 'gen_ai.request.model';
32
+ OpenTelemetryConstants.GEN_AI_REQUEST_TEMPERATURE_KEY = 'gen_ai.request.temperature';
33
+ OpenTelemetryConstants.GEN_AI_REQUEST_TOP_P_KEY = 'gen_ai.request.top_p';
34
+ OpenTelemetryConstants.GEN_AI_RESPONSE_ID_KEY = 'gen_ai.response.id';
35
+ OpenTelemetryConstants.GEN_AI_RESPONSE_FINISH_REASONS_KEY = 'gen_ai.response.finish_reasons';
36
+ OpenTelemetryConstants.GEN_AI_RESPONSE_MODEL_KEY = 'gen_ai.response.model';
37
+ OpenTelemetryConstants.GEN_AI_SYSTEM_KEY = 'gen_ai.system';
38
+ OpenTelemetryConstants.GEN_AI_SYSTEM_VALUE = 'az.ai.agent365';
39
+ OpenTelemetryConstants.GEN_AI_AGENT_ID_KEY = 'gen_ai.agent.id';
40
+ OpenTelemetryConstants.GEN_AI_AGENT_NAME_KEY = 'gen_ai.agent.name';
41
+ OpenTelemetryConstants.GEN_AI_AGENT_DESCRIPTION_KEY = 'gen_ai.agent.description';
42
+ OpenTelemetryConstants.GEN_AI_CONVERSATION_ID_KEY = 'gen_ai.conversation.id';
43
+ OpenTelemetryConstants.GEN_AI_CONVERSATION_ITEM_LINK_KEY = 'gen_ai.conversation.item.link';
44
+ OpenTelemetryConstants.GEN_AI_TOKEN_TYPE_KEY = 'gen_ai.token.type';
45
+ OpenTelemetryConstants.GEN_AI_USAGE_INPUT_TOKENS_KEY = 'gen_ai.usage.input_tokens';
46
+ OpenTelemetryConstants.GEN_AI_USAGE_OUTPUT_TOKENS_KEY = 'gen_ai.usage.output_tokens';
47
+ OpenTelemetryConstants.GEN_AI_CHOICE = 'gen_ai.choice';
48
+ OpenTelemetryConstants.GEN_AI_PROVIDER_NAME_KEY = 'gen_ai.provider.name';
49
+ OpenTelemetryConstants.GEN_AI_SYSTEM_INSTRUCTIONS_KEY = 'gen_ai.system_instructions';
50
+ OpenTelemetryConstants.GEN_AI_INPUT_MESSAGES_KEY = 'gen_ai.input.messages';
51
+ OpenTelemetryConstants.GEN_AI_OUTPUT_MESSAGES_KEY = 'gen_ai.output.messages';
52
+ OpenTelemetryConstants.GEN_AI_EVENT_CONTENT = 'gen_ai.event.content';
53
+ // Tool execution constants
54
+ OpenTelemetryConstants.GEN_AI_TOOL_CALL_ID_KEY = 'gen_ai.tool.call.id';
55
+ OpenTelemetryConstants.GEN_AI_TOOL_NAME_KEY = 'gen_ai.tool.name';
56
+ OpenTelemetryConstants.GEN_AI_TOOL_DESCRIPTION_KEY = 'gen_ai.tool.description';
57
+ OpenTelemetryConstants.GEN_AI_TOOL_ARGS_KEY = 'gen_ai.tool.call.arguments';
58
+ OpenTelemetryConstants.GEN_AI_TOOL_CALL_RESULT_KEY = 'gen_ai.event.content'; // GEN_AI_EVENT_CONTENT
59
+ OpenTelemetryConstants.GEN_AI_TOOL_TYPE_KEY = 'gen_ai.tool.type';
60
+ // Agent user (user tied to agent instance during creation) or caller dimensions
61
+ OpenTelemetryConstants.GEN_AI_AGENT_USER_ID_KEY = 'gen_ai.agent.userid';
62
+ OpenTelemetryConstants.GEN_AI_CALLER_USER_ID_KEY = 'gen_ai.caller.userid';
63
+ OpenTelemetryConstants.GEN_AI_CALLER_TENANT_ID_KEY = 'gen_ai.caller.tenantid';
64
+ OpenTelemetryConstants.GEN_AI_CALLER_ID_KEY = 'gen_ai.caller.id';
65
+ OpenTelemetryConstants.GEN_AI_CALLER_NAME_KEY = 'gen_ai.caller.name';
66
+ OpenTelemetryConstants.GEN_AI_CALLER_UPN_KEY = 'gen_ai.caller.upn';
67
+ // Agent to Agent caller agent dimensions
68
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_USER_ID_KEY = 'gen_ai.caller.agent.userid';
69
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_UPN_KEY = 'gen_ai.caller.agent.upn';
70
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_TENANT_ID_KEY = 'gen_ai.caller.agent.tenantid';
71
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_NAME_KEY = 'gen_ai.caller.agent.name';
72
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_ID_KEY = 'gen_ai.caller.agent.id';
73
+ OpenTelemetryConstants.GEN_AI_CALLER_AGENT_APPLICATION_ID_KEY = 'gen_ai.caller.agent.applicationid';
74
+ // Agent-specific dimensions
75
+ OpenTelemetryConstants.AGENT_ID_KEY = 'gen_ai.agent.id';
76
+ OpenTelemetryConstants.GEN_AI_TASK_ID_KEY = 'gen_ai.task.id';
77
+ OpenTelemetryConstants.SESSION_ID_KEY = 'session.id';
78
+ OpenTelemetryConstants.GEN_AI_ICON_URI_KEY = 'gen_ai.agent365.icon_uri';
79
+ OpenTelemetryConstants.TENANT_ID_KEY = 'tenant.id';
80
+ // Baggage keys
81
+ OpenTelemetryConstants.OPERATION_SOURCE_KEY = 'operation.source';
82
+ OpenTelemetryConstants.GEN_AI_AGENT_AUID_KEY = 'gen_ai.agent.user.id';
83
+ OpenTelemetryConstants.GEN_AI_AGENT_UPN_KEY = 'gen_ai.agent.upn';
84
+ OpenTelemetryConstants.GEN_AI_AGENT_BLUEPRINT_ID_KEY = 'gen_ai.agent.applicationid';
85
+ OpenTelemetryConstants.CORRELATION_ID_KEY = 'correlation.id';
86
+ OpenTelemetryConstants.HIRING_MANAGER_ID_KEY = 'hiring.manager.id';
87
+ // Execution context dimensions
88
+ OpenTelemetryConstants.GEN_AI_EXECUTION_TYPE_KEY = 'gen_ai.execution.type';
89
+ OpenTelemetryConstants.GEN_AI_EXECUTION_PAYLOAD_KEY = 'gen_ai.execution.payload';
90
+ // Source metadata dimensions
91
+ OpenTelemetryConstants.GEN_AI_EXECUTION_SOURCE_ID_KEY = 'gen_ai.execution.sourceMetadata.id';
92
+ OpenTelemetryConstants.GEN_AI_EXECUTION_SOURCE_NAME_KEY = 'gen_ai.channel.name';
93
+ OpenTelemetryConstants.GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY = 'gen_ai.channel.link';
94
+ // Custom parent id and parent name key
95
+ OpenTelemetryConstants.CUSTOM_PARENT_SPAN_ID_KEY = 'custom.parent.span.id';
96
+ OpenTelemetryConstants.CUSTOM_SPAN_NAME_KEY = 'custom.span.name';
97
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/tracing/constants.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;AAEjF;;GAEG;AACH,MAAM,OAAO,sBAAsB;;AACjC,uBAAuB;AACA,kDAA2B,GAAG,cAAc,CAAC;AAC7C,kDAA2B,GAAG,cAAc,CAAC;AAEpE,qCAAqC;AACd,qCAAc,GAAG,YAAY,CAAC;AAC9B,wCAAiB,GAAG,eAAe,CAAC;AACpC,uCAAgB,GAAG,cAAc,CAAC;AAClC,yCAAkB,GAAG,gBAAgB,CAAC;AACtC,sCAAe,GAAG,aAAa,CAAC;AAChC,+CAAwB,GAAG,6B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DAAuC,GAAG,qBAAqB,CAAC;AAEvF,uCAAuC;AAChB,gDAAyB,GAAG,uBAAuB,CAAC;AACpD,2CAAoB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Represents different types of agent invocations
3
+ */
4
+ export declare enum ExecutionType {
5
+ /** Direct human-to-agent invocation (e.g., through UI, API call) */
6
+ HumanToAgent = "HumanToAgent",
7
+ /** Agent-to-agent invocation (e.g., one agent calling another) */
8
+ Agent2Agent = "Agent2Agent",
9
+ /** Event-driven agent invocation (e.g., scheduled, webhook, message queue) */
10
+ EventToAgent = "EventToAgent",
11
+ /** Unknown or unspecified invocation type */
12
+ Unknown = "Unknown"
13
+ }
14
+ /**
15
+ * Represents different roles that can invoke an agent
16
+ */
17
+ export declare enum InvocationRole {
18
+ /** Human user invoking the agent */
19
+ Human = "Human",
20
+ /** Another agent invoking this agent */
21
+ Agent = "Agent",
22
+ /** Event-driven invocation (e.g., scheduled, webhook, message queue) */
23
+ Event = "Event",
24
+ /** Unknown or unspecified role */
25
+ Unknown = "Unknown"
26
+ }
27
+ /**
28
+ * Represents different operation for types for model inference
29
+ */
30
+ export declare enum InferenceOperationType {
31
+ CHAT = "Chat",
32
+ TEXT_COMPLETION = "TextCompletion",
33
+ GENERATE_CONTENT = "GenerateContent"
34
+ }
35
+ /**
36
+ * Represents metadata about the source of an invocation
37
+ */
38
+ export interface SourceMetadata {
39
+ /** Unique identifier for the source (e.g., agent ID, user ID, system component ID) */
40
+ id?: string;
41
+ /** Human-readable name of the source */
42
+ name?: string;
43
+ /** Optional icon identifier or URL for visual representation of the source */
44
+ iconUri?: string;
45
+ /** The role of the source invoking the agent */
46
+ role?: InvocationRole;
47
+ /** Optional description providing additional context about the source */
48
+ description?: string;
49
+ }
50
+ /**
51
+ * Represents a request to an agent with telemetry context
52
+ */
53
+ export interface AgentRequest {
54
+ /** The content of the request */
55
+ content: string;
56
+ /** The type of invocation (how the agent was called) */
57
+ executionType?: ExecutionType;
58
+ /** Optional session identifier for grouping related requests */
59
+ sessionId?: string;
60
+ /** Optional metadata about the source of the invocation */
61
+ sourceMetadata?: SourceMetadata;
62
+ }
63
+ /**
64
+ * Details about a tenant
65
+ */
66
+ export interface TenantDetails {
67
+ /** The unique identifier for the tenant */
68
+ tenantId: string;
69
+ }
70
+ /**
71
+ * Details about an AI agent
72
+ */
73
+ export interface AgentDetails {
74
+ /** The unique identifier for the AI agent */
75
+ agentId: string;
76
+ /** The identifier for the conversation or session */
77
+ conversationId?: string;
78
+ /** The human-readable name of the AI agent */
79
+ agentName?: string;
80
+ /** A description of the AI agent's purpose or capabilities */
81
+ agentDescription?: string;
82
+ /** Optional icon identifier or URL for visual representation of the agent */
83
+ iconUri?: string;
84
+ }
85
+ /**
86
+ * Details of a tool call made by an agent
87
+ */
88
+ export interface ToolCallDetails {
89
+ /** The name of the tool being executed */
90
+ toolName: string;
91
+ /** Tool arguments/parameters */
92
+ arguments?: string;
93
+ /** The unique identifier for the tool call */
94
+ toolCallId?: string;
95
+ /** Optional description of the tool or its purpose */
96
+ description?: string;
97
+ /** The type of the tool being executed */
98
+ toolType?: string;
99
+ /** The endpoint for the tool execution */
100
+ endpoint?: ServiceEndpoint;
101
+ }
102
+ /**
103
+ * Details about a caller
104
+ */
105
+ export interface CallerDetails {
106
+ /** The unique identifier for the caller */
107
+ callerId?: string;
108
+ /** The user principal name (UPN) of the caller */
109
+ callerUpn?: string;
110
+ /** The display name of the caller */
111
+ callerName?: string;
112
+ /** The user ID of the caller */
113
+ callerUserId?: string;
114
+ /** The tenant ID of the caller */
115
+ tenantId?: string;
116
+ }
117
+ /**
118
+ * Enhanced agent details with additional properties
119
+ */
120
+ export interface EnhancedAgentDetails extends AgentDetails {
121
+ /** The agent user ID (AUID) */
122
+ agentAUID?: string;
123
+ /** The agent user principal name (UPN) */
124
+ agentUPN?: string;
125
+ /** The agent blueprint/application ID */
126
+ agentBlueprintId?: string;
127
+ /** The tenant ID for the agent */
128
+ tenantId?: string;
129
+ }
130
+ /**
131
+ * Represents an endpoint for agent invocation
132
+ */
133
+ export interface ServiceEndpoint {
134
+ /** The host address */
135
+ host: string;
136
+ /** The port number */
137
+ port?: number;
138
+ /** The protocol (e.g., http, https) */
139
+ protocol?: string;
140
+ }
141
+ /**
142
+ * Details for invoking another agent
143
+ */
144
+ export interface InvokeAgentDetails extends EnhancedAgentDetails {
145
+ /** The request payload for the agent invocation */
146
+ request?: AgentRequest;
147
+ /** The endpoint for the agent invocation */
148
+ endpoint?: ServiceEndpoint;
149
+ /** Session ID for the invocation */
150
+ sessionId?: string;
151
+ }
152
+ /**
153
+ * Details for an inference call matching C# implementation
154
+ */
155
+ export interface InferenceDetails {
156
+ /** The operation name/type for the inference */
157
+ operationName: InferenceOperationType;
158
+ /** The model name/identifier */
159
+ model: string;
160
+ /** The provider name (e.g., openai, azure, anthropic) */
161
+ providerName?: string;
162
+ /** Number of input tokens used */
163
+ inputTokens?: number;
164
+ /** Number of output tokens generated */
165
+ outputTokens?: number;
166
+ /** Array of finish reasons */
167
+ finishReasons?: string[];
168
+ /** Response ID from the model provider */
169
+ responseId?: string;
170
+ }
171
+ /**
172
+ * Details for recording the response from an inference call
173
+ */
174
+ export interface InferenceResponse {
175
+ /** The generated response content */
176
+ content: string;
177
+ /** Response ID from the model provider */
178
+ responseId?: string;
179
+ /** Finish reason (e.g., stop, length, content_filter) */
180
+ finishReason?: string;
181
+ /** Number of input tokens used */
182
+ inputTokens?: number;
183
+ /** Number of output tokens generated */
184
+ outputTokens?: number;
185
+ }
186
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,oBAAY,aAAa;IACvB,oEAAoE;IACpE,YAAY,iBAAiB;IAE7B,kEAAkE;IAClE,WAAW,gBAAgB;IAE3B,8EAA8E;IAC9E,YAAY,iBAAiB;IAE7B,6CAA6C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,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,aAAa,EAAE,sBAAsB,CAAC;IAEtC,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAEhB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;CAEvB"}
@@ -0,0 +1,41 @@
1
+ // ------------------------------------------------------------------------------
2
+ // Copyright (c) Microsoft Corporation. All rights reserved.
3
+ // ------------------------------------------------------------------------------
4
+ /**
5
+ * Represents different types of agent invocations
6
+ */
7
+ export var ExecutionType;
8
+ (function (ExecutionType) {
9
+ /** Direct human-to-agent invocation (e.g., through UI, API call) */
10
+ ExecutionType["HumanToAgent"] = "HumanToAgent";
11
+ /** Agent-to-agent invocation (e.g., one agent calling another) */
12
+ ExecutionType["Agent2Agent"] = "Agent2Agent";
13
+ /** Event-driven agent invocation (e.g., scheduled, webhook, message queue) */
14
+ ExecutionType["EventToAgent"] = "EventToAgent";
15
+ /** Unknown or unspecified invocation type */
16
+ ExecutionType["Unknown"] = "Unknown";
17
+ })(ExecutionType || (ExecutionType = {}));
18
+ /**
19
+ * Represents different roles that can invoke an agent
20
+ */
21
+ export var InvocationRole;
22
+ (function (InvocationRole) {
23
+ /** Human user invoking the agent */
24
+ InvocationRole["Human"] = "Human";
25
+ /** Another agent invoking this agent */
26
+ InvocationRole["Agent"] = "Agent";
27
+ /** Event-driven invocation (e.g., scheduled, webhook, message queue) */
28
+ InvocationRole["Event"] = "Event";
29
+ /** Unknown or unspecified role */
30
+ InvocationRole["Unknown"] = "Unknown";
31
+ })(InvocationRole || (InvocationRole = {}));
32
+ /**
33
+ * Represents different operation for types for model inference
34
+ */
35
+ export var InferenceOperationType;
36
+ (function (InferenceOperationType) {
37
+ InferenceOperationType["CHAT"] = "Chat";
38
+ InferenceOperationType["TEXT_COMPLETION"] = "TextCompletion";
39
+ InferenceOperationType["GENERATE_CONTENT"] = "GenerateContent";
40
+ })(InferenceOperationType || (InferenceOperationType = {}));
41
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,4DAA4D;AAC5D,iFAAiF;AAEjF;;GAEG;AACH,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,oEAAoE;IACpE,8CAA6B,CAAA;IAE7B,kEAAkE;IAClE,4CAA2B,CAAA;IAE3B,8EAA8E;IAC9E,8CAA6B,CAAA;IAE7B,6CAA6C;IAC7C,oCAAmB,CAAA;AACrB,CAAC,EAZW,aAAa,KAAb,aAAa,QAYxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAYX;AAZD,WAAY,cAAc;IACxB,oCAAoC;IACpC,iCAAe,CAAA;IAEf,wCAAwC;IACxC,iCAAe,CAAA;IAEf,wEAAwE;IACxE,iCAAe,CAAA;IAEf,kCAAkC;IAClC,qCAAmB,CAAA;AACrB,CAAC,EAZW,cAAc,KAAd,cAAc,QAYzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAC9B,uCAAa,CAAA;IACb,4DAAmC,CAAA;IACnC,8DAAqC,CAAA;AACzC,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC"}
@@ -0,0 +1,53 @@
1
+ import { ExportResult } from '@opentelemetry/core';
2
+ import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
3
+ import { ClusterCategory } from '@microsoft/agents-a365-runtime';
4
+ /**
5
+ * Token resolver function type - supports both sync and async implementations
6
+ */
7
+ export type TokenResolver = (agentId: string, tenantId: string) => string | null | Promise<string | null>;
8
+ /**
9
+ * Observability span exporter for Agent365:
10
+ * - Partitions spans by (tenantId, agentId)
11
+ * - Builds OTLP-like JSON: resourceSpans -> scopeSpans -> spans
12
+ * - POSTs per group to https://{endpoint}/maven/agent365/agents/{agentId}/traces?api-version=1
13
+ * - Adds Bearer token via token_resolver(agentId, tenantId)
14
+ */
15
+ export declare class Agent365Exporter implements SpanExporter {
16
+ private readonly tokenResolver;
17
+ private readonly clusterCategory;
18
+ private closed;
19
+ constructor(tokenResolver: TokenResolver, clusterCategory?: ClusterCategory);
20
+ /**
21
+ * Export spans to Agent365 service
22
+ */
23
+ export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): Promise<void>;
24
+ /**
25
+ * Export a group of spans for a specific identity
26
+ */
27
+ private exportGroup;
28
+ /**
29
+ * HTTP POST with retry logic
30
+ */
31
+ private postWithRetries;
32
+ /**
33
+ * Sleep for specified milliseconds
34
+ */
35
+ private sleep;
36
+ /**
37
+ * Build OTLP export request payload
38
+ */
39
+ private buildExportRequest;
40
+ /**
41
+ * Map a ReadableSpan to OTLP span format
42
+ */
43
+ private mapSpan;
44
+ /**
45
+ * Shutdown the exporter
46
+ */
47
+ shutdown(): Promise<void>;
48
+ /**
49
+ * Force flush any pending spans
50
+ */
51
+ forceFlush(): Promise<void>;
52
+ }
53
+ //# sourceMappingURL=Agent365Exporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Agent365Exporter.d.ts","sourceRoot":"","sources":["../../../../src/tracing/exporter/Agent365Exporter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAA6B,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAyD5F;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE1G;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,MAAM,CAAS;gBAGrB,aAAa,EAAE,aAAa,EAC5B,eAAe,GAAE,eAAwB;IAU3C;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAuClG;;OAEG;YACW,WAAW;IAoCzB;;OAEG;YACW,eAAe;IA4C7B;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4C1B;;OAEG;IACH,OAAO,CAAC,OAAO;IAqFf;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}