Path: blob/main/pkg/integrations/v2/app_agent_receiver/testdata/foo.js
5318 views
function throwError() {1throw new Error('This is a thrown error');2}3function callUndefined() {4// eslint-disable-next-line no-eval5eval('test();');6}7function callConsole(method) {8// eslint-disable-next-line no-console9console[method](`This is a console ${method} message`);10}11function fetchError() {12fetch('http://localhost:12345', {13method: 'POST'14});15}16function promiseReject() {17new Promise((_accept, reject)=>{18reject('This is a rejected promise');19});20}21function fetchSuccess() {22fetch('http://localhost:1234');23}24function sendCustomMetric() {25window.grafanaJavaScriptAgent.api.pushMeasurement({26type: 'custom',27values: {28my_custom_metric: Math.random()29}30});31}32window.addEventListener('load', ()=>{33window.grafanaJavaScriptAgent.api.pushLog([34'Manual event from Home'35]);36});3738//# sourceMappingURL=foo.js.map394041