Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))

Comment thread
hectorhdzg marked this conversation as resolved.
## [0.1.0-alpha.1] - 2026-04-10

### Features Added
Expand All @@ -8,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.
Expand Down
File renamed without changes.
File renamed without changes.
21 changes: 12 additions & 9 deletions src/_a365/exporter/utils.ts → src/a365/exporter/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ 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<string> = 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";
Expand All @@ -30,8 +33,8 @@ export function partitionByIdentity(spans: ReadableSpan[]): Map<string, Readable

for (const span of spans) {
const attrs = span.attributes || {};
const tenant = asStr(attrs[TENANT_ID_KEY]);
const agent = asStr(attrs[GEN_AI_AGENT_ID_KEY]);
const tenant = asStr(attrs[ATTR_MICROSOFT_TENANT_ID]);
const agent = asStr(attrs[ATTR_GEN_AI_AGENT_ID]);

if (!tenant || !agent) {
skippedCount++;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/distro/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
InstrumentationOptions,
BrowserSdkLoaderOptions,
} from "../types.js";
import type { A365Options } from "../_a365/index.js";
import type { A365Options } from "../a365/index.js";

export type { InstrumentationOptions, BrowserSdkLoaderOptions, A365Options };

Expand Down
1 change: 1 addition & 0 deletions src/genai/semconv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ export const ATTR_GEN_AI_TOOL_TYPE = "gen_ai.tool.type" as const;

// Microsoft-specific (not in OTel semconv)
export const ATTR_MICROSOFT_SESSION_ID = "microsoft.session.id" as const;
export const ATTR_MICROSOFT_TENANT_ID = "microsoft.tenant.id" as const;
4 changes: 2 additions & 2 deletions src/genai/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
// separate truncation mechanisms vendored from A365:
// 1. truncateValue() here — 8,192 char limit on individual span attribute values,
// used by GenAI instrumentations (LangChain, OpenAI) before setting attributes.
// 2. truncateSpan() in _a365/exporter/utils.ts — 250KB limit on entire serialized
// 2. truncateSpan() in a365/exporter/utils.ts — 250KB limit on entire serialized
// spans, used by Agent365Exporter before posting to the A365 service.
// These serve different purposes (attribute-level vs span-level) and target
// different exporter backends. Need to determine:
// - What truncation Azure Monitor exporter expects/handles natively
// - What truncation OTLP exporter expects/handles natively
// - Whether attribute-level truncation should live in a shared location or
// remain exporter-specific under _a365/
// remain exporter-specific under a365/
// For now, keeping this here since GenAI instrumentations need it regardless
// of which exporter is active.

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export type {
} from "./distro/index.js";

// ── Re-exports from A365 configuration ──────────────────────────────────────
export { A365Configuration } from "./_a365/index.js";
export type { ClusterCategory, A365BaggageOptions, A365HostingOptions } from "./_a365/index.js";
export { A365Configuration } from "./a365/index.js";
export type { ClusterCategory, A365BaggageOptions, A365HostingOptions } from "./a365/index.js";

// ── Re-exports from types ───────────────────────────────────────────────────
export type { OpenAIAgentsInstrumentationConfig, LangChainInstrumentationConfig } from "./types.js";
Expand Down
2 changes: 1 addition & 1 deletion src/shared/jsonConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
BrowserSdkLoaderOptions,
InstrumentationOptions,
} from "../types.js";
import type { A365Options } from "../_a365/index.js";
import type { A365Options } from "../a365/index.js";
import type { AzureMonitorExporterOptions } from "@azure/monitor-opentelemetry-exporter";
import type { MicrosoftOpenTelemetryOptions } from "../distro/types.js";
import { Logger } from "./logging/index.js";
Expand Down
2 changes: 1 addition & 1 deletion test/internal/unit/a365/a365Configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { afterEach, assert, beforeEach, describe, it, vi } from "vitest";
import {
A365Configuration,
A365_ENV_VARS,
} from "../../../../src/_a365/configuration/A365Configuration.js";
} from "../../../../src/a365/configuration/A365Configuration.js";
import { JsonConfig } from "../../../../src/shared/jsonConfig.js";

describe("A365Configuration", () => {
Expand Down
6 changes: 3 additions & 3 deletions test/internal/unit/a365/agent365Exporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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> = {}): ReadableSpan {
return {
Expand Down
Loading