forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
605 B
17 lines
605 B
import { getEchoSrv, EchoEventType } from '@grafana/runtime';
|
|
import { captureException } from '@sentry/browser';
|
|
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 it's own metadata, applying any sampling rules,
|
|
// then push it to EchoSrv as SentryEvent
|
|
export const reportError = (error: Error) => captureException(error);
|
|
|