mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-09 05:08:44 +02:00
Merge branch 'agents/dotnet-aspire-opentelemetry-explorer'
This commit is contained in:
@@ -37,4 +37,46 @@ describe('createSidecarEnvironment', () => {
|
||||
HTTPS_PROXY: 'http://proxy.local:8080',
|
||||
});
|
||||
});
|
||||
|
||||
test('injects OTEL_EXPORTER_OTLP_ENDPOINT when OpenTelemetry is enabled', () => {
|
||||
expect(
|
||||
createSidecarEnvironment(
|
||||
{ PATH: 'C:\\tools' },
|
||||
{ enabled: true, endpoint: 'http://localhost:4317' },
|
||||
),
|
||||
).toEqual({
|
||||
PATH: 'C:\\tools',
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: 'http://localhost:4317',
|
||||
});
|
||||
});
|
||||
|
||||
test('does not inject OTEL_EXPORTER_OTLP_ENDPOINT when OpenTelemetry is disabled', () => {
|
||||
expect(
|
||||
createSidecarEnvironment(
|
||||
{ PATH: 'C:\\tools' },
|
||||
{ enabled: false, endpoint: 'http://localhost:4317' },
|
||||
),
|
||||
).toEqual({
|
||||
PATH: 'C:\\tools',
|
||||
});
|
||||
});
|
||||
|
||||
test('does not inject OTEL_EXPORTER_OTLP_ENDPOINT when settings are undefined', () => {
|
||||
expect(
|
||||
createSidecarEnvironment({ PATH: 'C:\\tools' }),
|
||||
).toEqual({
|
||||
PATH: 'C:\\tools',
|
||||
});
|
||||
});
|
||||
|
||||
test('does not inject OTEL_EXPORTER_OTLP_ENDPOINT when endpoint is empty', () => {
|
||||
expect(
|
||||
createSidecarEnvironment(
|
||||
{ PATH: 'C:\\tools' },
|
||||
{ enabled: true, endpoint: '' },
|
||||
),
|
||||
).toEqual({
|
||||
PATH: 'C:\\tools',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
|
||||
import {
|
||||
aspireDashboardContainerName,
|
||||
aspireDashboardImage,
|
||||
aspireDashboardUrls,
|
||||
createAspireDashboardRunArgs,
|
||||
createOpenTelemetryEnvironment,
|
||||
} from '../../scripts/aspireDashboard';
|
||||
|
||||
describe('aspire dashboard helpers', () => {
|
||||
test('creates the official standalone Docker command with mapped OTLP ports', () => {
|
||||
expect(createAspireDashboardRunArgs()).toEqual([
|
||||
'run',
|
||||
'--rm',
|
||||
'-d',
|
||||
'--name',
|
||||
aspireDashboardContainerName,
|
||||
'-p',
|
||||
'18888:18888',
|
||||
'-p',
|
||||
'4317:18889',
|
||||
'-p',
|
||||
'4318:18890',
|
||||
'-e',
|
||||
'ASPIRE_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS=true',
|
||||
aspireDashboardImage,
|
||||
]);
|
||||
});
|
||||
|
||||
test('injects OTLP exporter settings for local Aspire development', () => {
|
||||
expect(
|
||||
createOpenTelemetryEnvironment(
|
||||
{
|
||||
PATH: 'C:\\tools',
|
||||
},
|
||||
aspireDashboardUrls.otlpGrpc,
|
||||
),
|
||||
).toEqual({
|
||||
PATH: 'C:\\tools',
|
||||
OTEL_EXPORTER_OTLP_ENDPOINT: aspireDashboardUrls.otlpGrpc,
|
||||
OTEL_EXPORTER_OTLP_PROTOCOL: 'grpc',
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -6,12 +6,14 @@ import {
|
||||
groupApprovalToolsByProvider,
|
||||
listApprovalToolDefinitions,
|
||||
listApprovalToolNames,
|
||||
normalizeOpenTelemetrySettings,
|
||||
normalizeWorkspaceSettings,
|
||||
resolveProjectToolingSettings,
|
||||
resolveToolLabel,
|
||||
resolveWorkspaceToolingSettings,
|
||||
validateLspProfileDefinition,
|
||||
validateMcpServerDefinition,
|
||||
DEFAULT_OTEL_ENDPOINT,
|
||||
type LspProfileDefinition,
|
||||
type McpServerDefinition,
|
||||
type WorkspaceToolingSettings,
|
||||
@@ -118,6 +120,40 @@ describe('tooling settings helpers', () => {
|
||||
expect(normalizeWorkspaceSettings({ terminalHeight: Number.NaN }).terminalHeight).toBeUndefined();
|
||||
});
|
||||
|
||||
test('normalizes OpenTelemetry settings with defaults', () => {
|
||||
const otel = normalizeOpenTelemetrySettings();
|
||||
expect(otel.enabled).toBe(false);
|
||||
expect(otel.endpoint).toBe(DEFAULT_OTEL_ENDPOINT);
|
||||
});
|
||||
|
||||
test('preserves valid OpenTelemetry settings', () => {
|
||||
const otel = normalizeOpenTelemetrySettings({ enabled: true, endpoint: 'http://custom:4317' });
|
||||
expect(otel.enabled).toBe(true);
|
||||
expect(otel.endpoint).toBe('http://custom:4317');
|
||||
});
|
||||
|
||||
test('trims whitespace from OpenTelemetry endpoint', () => {
|
||||
const otel = normalizeOpenTelemetrySettings({ enabled: true, endpoint: ' http://localhost:4317 ' });
|
||||
expect(otel.endpoint).toBe('http://localhost:4317');
|
||||
});
|
||||
|
||||
test('falls back to default endpoint when blank', () => {
|
||||
const otel = normalizeOpenTelemetrySettings({ enabled: true, endpoint: ' ' });
|
||||
expect(otel.endpoint).toBe(DEFAULT_OTEL_ENDPOINT);
|
||||
});
|
||||
|
||||
test('normalizeWorkspaceSettings preserves OpenTelemetry when present', () => {
|
||||
const settings = normalizeWorkspaceSettings({
|
||||
openTelemetry: { enabled: true, endpoint: 'http://jaeger:4317' },
|
||||
});
|
||||
expect(settings.openTelemetry).toEqual({ enabled: true, endpoint: 'http://jaeger:4317' });
|
||||
});
|
||||
|
||||
test('normalizeWorkspaceSettings omits OpenTelemetry when absent', () => {
|
||||
const settings = normalizeWorkspaceSettings({});
|
||||
expect(settings.openTelemetry).toBeUndefined();
|
||||
});
|
||||
|
||||
test('validates required MCP transport settings', () => {
|
||||
const localServer: McpServerDefinition = {
|
||||
id: 'mcp-local',
|
||||
|
||||
Reference in New Issue
Block a user