Skip to content

feat(integriq): build observability-opentelemetry-export-errors-and-app-spans - #3602

Merged
rubenvdlinde merged 6 commits into
developmentfrom
quality/build-observability-opentelemetry-export-errors-and-app-spans
Nov 17, 2026
Merged

rubenvdlinde merged 6 commits into
developmentfrom
quality/build-observability-opentelemetry-export-errors-and-app-spans

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Builds openspec/changes/observability-opentelemetry-export-errors-and-app-spans (tasks 6 to 9; part two of observability-opentelemetry-export, whose tasks 1 to 5 are on development).

Tasks done

  • Task 6, error sink listener and queue: ErrorSinkListener on OCP\Log\BeforeMessageLoggedEvent queues one ErrorSinkExportJob per selected message (app list + minimum level). It makes no HTTP call, never logs, swallows its own errors and ignores messages it causes itself. The job retries 3 times (after 5, 10 and 20 minutes), then drops the event silently. Registered through ObservabilityBindings, with a wiring test.
  • Task 7, exporters: SentryEnvelopeExporter (DSN → /api/{id}/envelope/, X-Sentry-Auth from the key) and OtlpLogExporter ({endpoint}/v1/logs, OTLP JSON resourceLogs). The message and file are redacted before queueing; this uses the new BodyRedactor::redactText(), which also strips BSN-shaped numbers.
  • Task 8, span command: SpanExportRequestedEvent answers no-listener until it is handled. SpanExportRequestedListener validates spans (rejection reasons name the field), drops attributes outside the allowlist, answers export-disabled when export is off, and queues valid spans through the same job, which exports them with service.name set to the sending app. The contract for sibling apps, including the class_exists() guard, is in docs/features/opentelemetry.md.
  • Task 9, admin settings: errorsink_* settings with validation: an enabled sink needs an endpoint, and http is accepted only for a host marked internal. GET/PUT /api/admin/errorsink (documented in openapi.json). An admin section next to the collector settings. 11 frontend and 9 backend strings, in en and nl.

Tasks left

  • The Playwright extension of tests/e2e/opentelemetry-export.spec.ts (task 9) needs a running Nextcloud and is left unchecked. SettingsServiceTest::testAnEnabledErrorSinkNeedsAnEndpoint is done.
  • openregister and opencatalogi do not send spans yet: each needs its own change that dispatches SpanExportRequestedEvent from its request path.
  • The span listener test dispatches through the repo's tests/Helpers/ServiceListenerDispatcher, wired by the real Application::register(), because Nextcloud's own dispatcher is not in the unit autoload.

Tests

40 new tests: ErrorSinkListenerTest 7, ErrorSinkExporterTest 8, SettingsServiceTest 6, SpanExportRequestedListenerTest 10, SpanExportRequestedEventTest 2, BodyRedactorTextTest 2, ErrorSinkSettingsControllerTest 4, ObservabilityBindingsTest +1.

Unit suite: before, Tests: 8493, Errors: 2, Failures: 3; after, Tests: 8533, Errors: 2, Failures: 2. The remaining errors and failures are inherited from development (CallServiceTest x2, JobsControllerTest::testUnknownJobIsNotFound x2). The third failure in the before run, SynchronizationSynchronizeEntryGoldenTest, also fails on development; it passed in this run.
Diff check: php -l clean; phpcs 0 errors; phpstan on the changed lib files OK; eslint clean on the touched Vue files; check:l10n-js up to date; test:l10n OK.


Generated by Claude Code

…pp-spans [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
…rt-errors-and-app-spans [skip ci]

Regenerate l10n/en.js and l10n/nl.js from the merged .json catalogues (30
keys were present in the .json but missing from the .js).

Assisted-by: ClaudeCode:claude-opus-5-5
…rt-errors-and-app-spans [skip ci]

Development rebuilt SettingsService around the retention settings; the
error sink methods move onto it, its tests into
SettingsServiceErrorSinkTest, and the service factory now passes the
error sink store, which it did not before, so the admin endpoint no
longer throws.

Assisted-by: ClaudeCode:claude-opus-5-5
…rt-errors-and-app-spans [skip ci]

Resolve the l10n and AdminSettings.vue conflicts by keeping both sides'
strings and @SPEC tags.

Assisted-by: ClaudeCode:claude-opus-5-5
…rt-errors-and-app-spans [skip ci]

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit 5622162 into development Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant