[SDTEST-3772] Implement TelemetryExporter#266
Merged
Conversation
Adds TelemetryExporter — a file-backed batching exporter that serialises telemetry items to disk and uploads them as message-batch envelopes via TelemetryApi. Refactors the internal wire types (TelemetryMetric, TelemetryLog.Logs, TelemetryAppStarted/Heartbeat/Closing, TelemetryMessageBatch) into public Codable structs that conform to a new TelemetryPayload protocol. Cleans up ClosureDataUploader / DataUploadStatus to use typed APICallError throws throughout, and extends MockBackend with an /api/v2/apmtelemetry endpoint and waitForTelemetry() helper. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
anmarchenko
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TelemetryExporter— a file-backed batching exporter that writes telemetry items to disk and uploads them asmessage-batchenvelopes viaTelemetryApiTelemetryMetric,TelemetryLog.Logs,TelemetryAppStarted/Heartbeat/Closing,TelemetryMessageBatch) into publicCodablestructs conforming to a newTelemetryPayloadprotocol; replaces the oldTelemetryBatchItemenumClosureDataUploader/DataUploadStatusto use typedAPICallErrorthrows throughout; extendsMockBackendwith/api/v2/apmtelemetryendpoint andwaitForTelemetry()helperTest plan
TelemetryExporterTests/testExportMetrics_uploadsWellFormedEnvelope— single metric item produces a validmessage-batchenvelopeTelemetryExporterTests/testExportLogs_uploadsWellFormedEnvelope— single log item produces a valid envelopeTelemetryExporterTests/testExportMultipleItems_batchedInOneFile_uploadedAsOneEnvelope— multiple items written to one file are batched into a single uploadTelemetryExporterTests/testExportMultipleItems_acrossSeparateFiles_eachUploadedIndependently— items written to separate files produce independent uploadsEventsExportertest suite passes with no regressionsJira: SDTEST-3772
🤖 Generated with Claude Code