You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced-configuration-options.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,19 +39,19 @@ this option if your application relies on security manager to run untrusted code
39
39
40
40
## JavaScript snippet injection
41
41
42
-
This experimental feature allows you to inject JavaScript code into HTML responses from servlet applications. The agent will look for the `</head>` tag in HTML responses, and inject the configured JavaScript snippet before the closing `</head>` tag.
42
+
This experimental feature allows you to inject JavaScript code into HTML responses from servlet applications. The agent will look for the `<head>` tag in HTML responses, and inject the configured JavaScript snippet after it.
43
43
44
44
This feature is designed for integrating client-side monitoring.
45
45
We plan to integrate OpenTelemetry's own client-side monitoring solution by default once it's available
46
46
(see the [browser instrumentation proposal](https://github.com/open-telemetry/community/blob/main/projects/browser-phase-1.md)).
47
47
48
-
| System property | Environment variable | Purpose |
| otel.experimental.javascript-snippet | OTEL_EXPERIMENTAL_JAVASCRIPT_SNIPPET |JavaScript code to inject into HTML responses before the closing`</head>` tag. The value should be a complete JavaScript snippet including `<script>` tags if needed, e.g. `-Dotel.experimental.javascript-snippet="<script>console.log('Hello world!');</script>"`|
48
+
| System property | Environment variable | Purpose |
| otel.experimental.javascript-snippet | OTEL_EXPERIMENTAL_JAVASCRIPT_SNIPPET |Experimental setting to inject a JavaScript snippet into HTML responses after the opening`<head>` tag. The value should be a complete JavaScript snippet including `<script>` tags if needed, e.g. `-Dotel.experimental.javascript-snippet="<script>console.log('Hello world!');</script>"`|
51
51
52
52
**Important notes:**
53
53
54
54
- This only works with servlet-based applications currently
55
-
- The snippet is injected only into HTML responses that contain a `</head>` tag
55
+
- The snippet is injected only into HTML responses that contain a `<head>` tag
56
56
- The agent will attempt to preserve the original character encoding of the response
57
57
- If the response already has a `Content-Length` header, it will be updated to reflect the additional content
0 commit comments