Menu
Choose a product
Scroll for more
Documentation
Grafana Cloud
Monitor applications
Frontend Observability
Configure
Auto-inject the SDK
Grafana Cloud
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.
nginx
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
Additional helpful documentation, links, and articles:
Video

Getting started with managing your metrics, logs, and traces using Grafana
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
Video

Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
Video

Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.