mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-06 19:58:43 +02:00
feat: add OpenTelemetry settings UI and sidecar environment wiring
Add a global Telemetry section in the settings panel with: - Toggle to enable/disable OTLP export - Text input for the OTLP endpoint URL (default: http://localhost:4317) - Guidance note about using \un run aspire\ for local testing Wire the setting through the full stack: - OpenTelemetrySettings type in shared domain with normalization - IPC channel, preload binding, and handler for persistence - SidecarClient forwards settings to createSidecarEnvironment - Sidecar environment injects OTEL_EXPORTER_OTLP_ENDPOINT when enabled - Settings loaded from workspace.json on startup and on change Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user