News · · javascript · spec · opentelemetry

OpenTelemetry GenAI conventions for JavaScript

Set one flag and the JavaScript instrumentations also emit OpenTelemetry GenAI gen_ai.* attributes, right next to the OpenInference ones.

If your backend expects the OpenTelemetry GenAI semantic conventions, you no longer have to choose. The JavaScript instrumentations can now emit gen_ai.* attributes on the same spans as their OpenInference attributes. Python already could; JavaScript has caught up.

Set one environment variable:

OPENINFERENCE_ENABLE_GENAI_SEMCONV=true node app.js

Or, if you’d rather do it in code, pass traceConfig: { enableGenAISemconv: true } to your instrumentation.

That’s it. Your spans keep everything they had and also get the model, provider, token usage, messages and tool calls under their gen_ai.* names. If you mask inputs or outputs, they stay masked there too.

It works with any instrumentation on @arizeai/openinference-core 2.9.0 or later. It’s experimental and off by default, so try it and tell us what breaks.

The details are in the specification.

Release notes