From 9f065a8835b6b105ab28dd86ed0caff35c47d894 Mon Sep 17 00:00:00 2001 From: Kostas Pelelis <13784424+kpelelis@users.noreply.github.com> Date: Wed, 14 Jun 2023 13:18:28 +0300 Subject: [PATCH] EchoBackend: Make EchoSrvTransport batched (#70012) Make EchoSrvTransport batched With the update of faro web sdk to 1.1.0, batching was introduced, in which several telemetry signals can be grouped together in a fixed interval or buffer length. The current setup in which the EchoSrvTransport was proxying signals through the Echo Backend was yielding the following issue. The updated Fetch transport is batched but the way it was being used by the `GrafanaJavascriptAgentBackend` was pushing single items. --- .../grafana-javascript-agent/EchoSrvTransport.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/app/core/services/echo/backends/grafana-javascript-agent/EchoSrvTransport.ts b/public/app/core/services/echo/backends/grafana-javascript-agent/EchoSrvTransport.ts index 9aef20a2f64..a7c88c126d7 100644 --- a/public/app/core/services/echo/backends/grafana-javascript-agent/EchoSrvTransport.ts +++ b/public/app/core/services/echo/backends/grafana-javascript-agent/EchoSrvTransport.ts @@ -3,12 +3,17 @@ import { getEchoSrv, EchoEventType, config } from '@grafana/runtime'; export class EchoSrvTransport extends BaseTransport { readonly name: string = 'EchoSrvTransport'; readonly version: string = config.buildInfo.version; - send(event: TransportItem) { + send(items: TransportItem[]) { getEchoSrv().addEvent({ type: EchoEventType.GrafanaJavascriptAgent, - payload: event, + payload: items, }); } + + isBatched() { + return true; + } + getIgnoreUrls() { return []; }