Telemetry Configuration

GQLForge supports OpenTelemetry-based observability. You can export traces, metrics, and logs to multiple backends.

Fields

FieldTypeDescription
exportExportConfigConfigures where telemetry data is sent.
request_headers[String]HTTP request headers captured and attached as span attributes.

Export Targets

TargetDescription
StdoutPrints telemetry data to standard output. Useful for local development.
OtlpSends data to an OpenTelemetry Protocol (OTLP) compatible collector.
PrometheusExposes a /metrics endpoint for Prometheus scraping.

OTLP Configuration

When using Otlp, provide an url pointing to the collector endpoint.

Examples

Export to stdout

schema @telemetry(export: { format: Stdout }) @server(port: 8000) {
  query: Query
}

Export to an OTLP collector

schema
@telemetry(
  export: { format: Otlp, url: "http://localhost:4317" }
  request_headers: ["X-Request-Id", "Authorization"]
)
@server(port: 8000) {
  query: Query
}

Expose Prometheus metrics

schema @telemetry(export: { format: Prometheus }) @server(port: 8000) {
  query: Query
}

With this configuration, metrics are available at http://localhost:8000/metrics for Prometheus to scrape.