1.11.0 • Published 9 months ago

@grafana/faro-instrumentation-xhr v1.11.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

@grafana/instrumentation-xhr

Faro instrumentation of the JavaScript XMLHttpRequest (XHR) API

❗️Warning: this package is experimental and may be subject to frequent and breaking changes. Use at your own risk.❗️

Installation and Usage

❗️Warning: This package is not interoperable with @opentelemetry/instrumentation-xml-http-request. Use one or the other❗️

// index.ts
import { XHRInstrumentation } from '@grafana/faro-instrumentation-xhr';
import { getWebInstrumentations, initializeFaro } from '@grafana/faro-react';

initializeFaro({
  // see the full set of options in the @grafana/faro-core README.md
  instrumentations: [
    // Load the default Web instrumentations
    ...getWebInstrumentations(),
    // Add XHR instrumentation
    new XHRInstrumentation({
      // specify ignoredUrls to prevent telemetry data from being sent to Faro when making requests to those URLs
      ignoredUrls: [/^https:\/\/www\.google-analytics\.com\/collect/],
    }),
  ],
});

// myApi.ts
const req = new XMLHttpRequest();
req.open('GET', '...');
req.send(); // use XHR as normal - telemetry data is sent to your Faro endpoint

Backend correlation

In order to prepare backend correlation, this instrumentation adds the following headers to each request that server-side instrumentation can use as context:

  • x-faro-session - the client-side session id
1.11.0

9 months ago

1.10.2

9 months ago

1.10.1

10 months ago

1.10.0

10 months ago

1.9.1

11 months ago

1.8.2

1 year ago

1.7.3

1 year ago

1.9.0

12 months ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.2

1 year ago

1.7.1

1 year ago

1.7.0

1 year ago

1.6.0

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago