Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/configure/inject-instrumentation.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/configure/inject-instrumentation/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Automatically inject the RUM SDK into your sites
Sometimes you cannot add the RUM SDK snippet to an application. This could be because a different internal team owns the app or because the app is in maintenance mode.
This document highlights a strategy that you can use to inject the snippet, so that you can still use Grafana Faro in these scenarios.
Note
We recommend directly adding the Web SDK to the applications, so they can use the SDK to augment the automatically created telemetry.
Requirements
This approach requires a reverse proxy technology that sits in front of the served application and can modify the response content.
Example (nginx)
An nginx implementation could be as simple as adding a sub_filter directive to the location that is used to reverse-proxy the application.
location / {
# example value
proxy_pass http://app:8080/;
# we match the closing `head` tag and append a script snippet
sub_filter '</head>' '</head>
<!-- replace the next line with the "CDN" snippet from the Configuration page -->
<script></script>';
sub_filter_once on;
}Learn more
- Learn more about the
sub_filterdirective in the nginxsub_moduledocumentation. - Refer to complete nginx configuration.
Was this page helpful?
Related resources from Grafana Labs


