June, 2025 release

Enabling OpenTelemetry for the Ruby storefront

You can use the OpenTelemetry toolkit with Ruby storefronts. Since Ruby is a Next.js application, you enable and interact with it using a different method than the standard Java agent.

Pages Router

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

To enable OpenTelemetry for Ruby Next.js stores:
  • 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.