Image Render: Propagate traces in HTTP mode (#100559)

* Rendering: Propagate traces in HTTP mode

* update ini file

* update docs

* update doc

* fix imports

* fix go files

* fix CI

* update ini config

* remove servicename

---------

Co-authored-by: AgnesToulet <35176601+AgnesToulet@users.noreply.github.com>
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
Lucy Chen
2025-03-06 12:02:00 -05:00
committed by GitHub
co-authored by AgnesToulet nmarrs
parent 3247105d6a
commit 5996e102af
5 changed files with 28 additions and 2 deletions
+3
View File
@@ -1875,6 +1875,9 @@ rendering_dumpio =
# This can be useful to enable (true) when optimizing the rendering mode settings to improve the plugin performance or when troubleshooting.
rendering_timing_metrics =
# This is a configuration for OTLP exporter with HTTP protocol, set this URL to enable tracing (ex: http://localhost:4318/v1/traces). Default to empty (tracing disabled).
rendering_tracing_url =
# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
rendering_args =
+3
View File
@@ -1809,6 +1809,9 @@ timeout = 30s
# This can be useful to enable (true) when optimizing the rendering mode settings to improve the plugin performance or when troubleshooting.
;rendering_timing_metrics =
# This is a configuration for OTLP exporter with HTTP protocol, set this URL to enable tracing (ex: http://localhost:4318/v1/traces). Default to empty (tracing disabled).
;rendering_tracing_url =
# Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found
# here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character.
;rendering_args =
@@ -580,3 +580,21 @@ RENDERING_VIEWPORT_PAGE_ZOOM_LEVEL=1
}
}
```
#### Tracing
Enable OpenTelemetry Tracing by setting the tracing URL. Default is empty (disabled).
```bash
RENDERING_TRACING_URL="http://localhost:4318/v1/traces"
```
```json
{
"rendering": {
"tracing": {
"url": "http://localhost:4318/v1/traces"
}
}
}
```
+1 -1
View File
@@ -519,7 +519,7 @@ require (
go.opencensus.io v0.24.0 // @grafana/grafana-backend-group
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.33.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // @grafana/sharing-squad
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.34.0 // indirect
go.opentelemetry.io/otel/metric v1.34.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
+3 -1
View File
@@ -14,6 +14,8 @@ import (
"os"
"strconv"
"time"
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
)
var netTransport = &http.Transport{
@@ -25,7 +27,7 @@ var netTransport = &http.Transport{
}
var netClient = &http.Client{
Transport: netTransport,
Transport: otelhttp.NewTransport(netTransport),
}
const authTokenHeader = "X-Auth-Token" //#nosec G101 -- This is a false positive