mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
20 lines
606 B
TypeScript
20 lines
606 B
TypeScript
import { captureException } from '@sentry/browser';
|
|
|
|
import { getEchoSrv, EchoEventType } from '@grafana/runtime';
|
|
|
|
import { PerformanceEvent } from './backends/PerformanceBackend';
|
|
|
|
export const reportPerformance = (metric: string, value: number) => {
|
|
getEchoSrv().addEvent<PerformanceEvent>({
|
|
type: EchoEventType.Performance,
|
|
payload: {
|
|
name: metric,
|
|
value: value,
|
|
},
|
|
});
|
|
};
|
|
|
|
// Sentry will process the error, adding its own metadata, applying any sampling rules,
|
|
// then push it to EchoSrv as SentryEvent
|
|
export const reportError = (error: Error) => captureException(error);
|