Enabling OpenTelemetry for containers

When OpenTelemetry (OTEL) is enabled in the Helm chart, it is enabled for all containers, including Ruby. This page explains how to use the OpenTelemetry toolkit with Ruby storefronts.

Pages Router

The Ruby storefront implementation of OpenTelemetry uses pages router request-id tracking. This capability is set using environment variables.

To enable OpenTelemetry for Ruby storefront:
  • Set OTEL_JAVAAGENT_ENABLED to true, or,
  • Set NEXTJS_OTEL_ENABLED to any value other than false.
OpenTelemetry defines its own environment variables, which are documented on the OpenTelemetry website. The OTEL_EXPORTER_OTLP_ENDPOINT variable must be set in the environment for traces and spans to be sent to the OpenTelemetry server. This is the only mandatory variable from the OpenTelemetry toolkit.

Additional features

You may use other OpenTelemetry variables as appropriate for your environment. You may need to set some of these environment variables to push traces and spans to any custom endpoints you have configured to receive them.