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.
This commit is contained in:
Kostas Pelelis 2023-06-14 13:18:28 +03:00 committed by GitHub
parent b60b43640f
commit 9f065a8835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 [];
}