Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/configure/inject-instrumentation.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/configure/inject-instrumentation/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use 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


