From e4da7567dfde396e00ad74dfc8755e84f71e5530 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:14:16 -0700 Subject: [PATCH 1/2] Add A365 Exporter --- CHANGELOG.md | 5 +++++ .../configuration/A365Configuration.ts | 0 .../configuration/A365ConfigurationOptions.ts | 0 src/{_a365 => a365}/configuration/index.ts | 0 .../exporter/Agent365Exporter.ts | 0 .../exporter/Agent365ExporterOptions.ts | 0 .../exporter/ExporterEventNames.ts | 0 src/{_a365 => a365}/exporter/index.ts | 0 src/{_a365 => a365}/exporter/utils.ts | 18 +++++++++--------- src/{_a365 => a365}/index.ts | 0 src/{_a365 => a365}/utils/utils.ts | 0 src/distro/types.ts | 2 +- src/genai/semconv.ts | 1 + src/genai/utils.ts | 4 ++-- src/index.ts | 4 ++-- src/shared/jsonConfig.ts | 2 +- .../unit/a365/a365Configuration.test.ts | 2 +- .../unit/a365/agent365Exporter.test.ts | 6 +++--- 18 files changed, 25 insertions(+), 19 deletions(-) rename src/{_a365 => a365}/configuration/A365Configuration.ts (100%) rename src/{_a365 => a365}/configuration/A365ConfigurationOptions.ts (100%) rename src/{_a365 => a365}/configuration/index.ts (100%) rename src/{_a365 => a365}/exporter/Agent365Exporter.ts (100%) rename src/{_a365 => a365}/exporter/Agent365ExporterOptions.ts (100%) rename src/{_a365 => a365}/exporter/ExporterEventNames.ts (100%) rename src/{_a365 => a365}/exporter/index.ts (100%) rename src/{_a365 => a365}/exporter/utils.ts (96%) rename src/{_a365 => a365}/index.ts (100%) rename src/{_a365 => a365}/utils/utils.ts (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39311199..3bdc1da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Release History +## [0.1.0-alpha.2] - Unreleased + +### Features Added +- Add A365 Exporter.([#15](https://github.com/microsoft/opentelemetry-distro-javascript/pull/15)) + ## [0.1.0-alpha.1] - 2026-04-10 ### Features Added diff --git a/src/_a365/configuration/A365Configuration.ts b/src/a365/configuration/A365Configuration.ts similarity index 100% rename from src/_a365/configuration/A365Configuration.ts rename to src/a365/configuration/A365Configuration.ts diff --git a/src/_a365/configuration/A365ConfigurationOptions.ts b/src/a365/configuration/A365ConfigurationOptions.ts similarity index 100% rename from src/_a365/configuration/A365ConfigurationOptions.ts rename to src/a365/configuration/A365ConfigurationOptions.ts diff --git a/src/_a365/configuration/index.ts b/src/a365/configuration/index.ts similarity index 100% rename from src/_a365/configuration/index.ts rename to src/a365/configuration/index.ts diff --git a/src/_a365/exporter/Agent365Exporter.ts b/src/a365/exporter/Agent365Exporter.ts similarity index 100% rename from src/_a365/exporter/Agent365Exporter.ts rename to src/a365/exporter/Agent365Exporter.ts diff --git a/src/_a365/exporter/Agent365ExporterOptions.ts b/src/a365/exporter/Agent365ExporterOptions.ts similarity index 100% rename from src/_a365/exporter/Agent365ExporterOptions.ts rename to src/a365/exporter/Agent365ExporterOptions.ts diff --git a/src/_a365/exporter/ExporterEventNames.ts b/src/a365/exporter/ExporterEventNames.ts similarity index 100% rename from src/_a365/exporter/ExporterEventNames.ts rename to src/a365/exporter/ExporterEventNames.ts diff --git a/src/_a365/exporter/index.ts b/src/a365/exporter/index.ts similarity index 100% rename from src/_a365/exporter/index.ts rename to src/a365/exporter/index.ts diff --git a/src/_a365/exporter/utils.ts b/src/a365/exporter/utils.ts similarity index 96% rename from src/_a365/exporter/utils.ts rename to src/a365/exporter/utils.ts index 8c7acb2d..9712f804 100644 --- a/src/_a365/exporter/utils.ts +++ b/src/a365/exporter/utils.ts @@ -6,15 +6,15 @@ import { SpanKind, SpanStatusCode } from "@opentelemetry/api"; import type { ClusterCategory } from "../configuration/A365ConfigurationOptions.js"; import { Logger } from "../../shared/logging/index.js"; import { ExporterEventNames } from "./ExporterEventNames.js"; - -// Attribute keys for identity partitioning (from Agent365 OpenTelemetryConstants) -const TENANT_ID_KEY = "microsoft.tenant.id"; -const GEN_AI_AGENT_ID_KEY = "gen_ai.agent.id"; +import { + ATTR_GEN_AI_AGENT_ID, + ATTR_GEN_AI_INPUT_MESSAGES, + ATTR_GEN_AI_OUTPUT_MESSAGES, + ATTR_MICROSOFT_TENANT_ID, +} from "../../genai/semconv.js"; // Message attribute keys that receive special truncation handling -const GEN_AI_INPUT_MESSAGES_KEY = "gen_ai.input.messages"; -const GEN_AI_OUTPUT_MESSAGES_KEY = "gen_ai.output.messages"; -const MESSAGE_ATTR_KEYS = new Set([GEN_AI_INPUT_MESSAGES_KEY, GEN_AI_OUTPUT_MESSAGES_KEY]); +const MESSAGE_ATTR_KEYS: Set = new Set([ATTR_GEN_AI_INPUT_MESSAGES, ATTR_GEN_AI_OUTPUT_MESSAGES]); // A365 message schema version used in overflow sentinels const A365_MESSAGE_SCHEMA_VERSION = "1.0"; @@ -30,8 +30,8 @@ export function partitionByIdentity(spans: ReadableSpan[]): Map { diff --git a/test/internal/unit/a365/agent365Exporter.test.ts b/test/internal/unit/a365/agent365Exporter.test.ts index 81fdf74b..1c3c0510 100644 --- a/test/internal/unit/a365/agent365Exporter.test.ts +++ b/test/internal/unit/a365/agent365Exporter.test.ts @@ -5,7 +5,7 @@ import { afterEach, assert, beforeEach, describe, it, vi } from "vitest"; import { ExportResultCode } from "@opentelemetry/core"; import { SpanKind, SpanStatusCode, TraceFlags } from "@opentelemetry/api"; import type { ReadableSpan } from "@opentelemetry/sdk-trace-base"; -import { Agent365Exporter } from "../../../../src/_a365/exporter/Agent365Exporter.js"; +import { Agent365Exporter } from "../../../../src/a365/exporter/Agent365Exporter.js"; import { partitionByIdentity, parseIdentityKey, @@ -16,8 +16,8 @@ import { resolveAgent365Endpoint, truncateSpan, MAX_SPAN_SIZE_BYTES, -} from "../../../../src/_a365/exporter/utils.js"; -import { ResolvedExporterOptions } from "../../../../src/_a365/exporter/Agent365ExporterOptions.js"; +} from "../../../../src/a365/exporter/utils.js"; +import { ResolvedExporterOptions } from "../../../../src/a365/exporter/Agent365ExporterOptions.js"; function makeSpan(overrides: Partial = {}): ReadableSpan { return { From c0ddaa79219fe2936e1bef03397f6c1879ce3898 Mon Sep 17 00:00:00 2001 From: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:23:52 -0700 Subject: [PATCH 2/2] Format --- CHANGELOG.md | 4 ++-- src/a365/exporter/utils.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bdc1da6..49bc5460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [0.1.0-alpha.2] - Unreleased ### Features Added -- Add A365 Exporter.([#15](https://github.com/microsoft/opentelemetry-distro-javascript/pull/15)) +- Add A365 Exporter. ([#15](https://github.com/microsoft/opentelemetry-distro-javascript/pull/15)) ## [0.1.0-alpha.1] - 2026-04-10 @@ -13,7 +13,7 @@ - Modular setup architecture with extension points for OTLP and A365. - Migrated `@azure/monitor-opentelemetry` distro code in-repo for direct iteration. - Microsoft OpenTelemetry distro rebranding and configuration support. -- Add langchain isntrumentation.([#10](https://github.com/microsoft/opentelemetry-distro-javascript/pull/10)) +- Add langchain instrumentation. ([#10](https://github.com/microsoft/opentelemetry-distro-javascript/pull/10)) ### Other Changes - Initial project scaffolding with TypeScript, ESLint, and Vitest. diff --git a/src/a365/exporter/utils.ts b/src/a365/exporter/utils.ts index 9712f804..2eb0234d 100644 --- a/src/a365/exporter/utils.ts +++ b/src/a365/exporter/utils.ts @@ -14,7 +14,10 @@ import { } from "../../genai/semconv.js"; // Message attribute keys that receive special truncation handling -const MESSAGE_ATTR_KEYS: Set = new Set([ATTR_GEN_AI_INPUT_MESSAGES, ATTR_GEN_AI_OUTPUT_MESSAGES]); +const MESSAGE_ATTR_KEYS: Set = new Set([ + ATTR_GEN_AI_INPUT_MESSAGES, + ATTR_GEN_AI_OUTPUT_MESSAGES, +]); // A365 message schema version used in overflow sentinels const A365_MESSAGE_SCHEMA_VERSION = "1.0";