OpenInference Semantic Conventions

Spring AI provides built-in instrumentation for models, tools, and agentic workflows based on the Micrometer APIs. Arconia lets you configure your Spring AI applications to export telemetry data adopting the OpenInference Semantic Conventions instead of the default Micrometer conventions, enabling rich trace visualization in platforms like Arize Phoenix and Arize AX.

Arconia provides a Phoenix Dev Service you can use during development and testing. Check out the Phoenix Dev Service documentation for more details.

The OpenInference Semantic Conventions are still experimental, and they might change in the future.

Getting Started

Add the Arconia OpenInference AI Semantic Conventions dependency to your project.

  • Gradle

  • Maven

dependencies {
  implementation 'io.arconia:arconia-openinference-ai-semantic-conventions'
}
<dependency>
    <groupId>io.arconia</groupId>
    <artifactId>arconia-openinference-ai-semantic-conventions</artifactId>
</dependency>

If another Generative AI convention module is also active, Arconia fails at startup with an actionable error message. Disable the unwanted module via its enabled property.

Your application also needs OpenTelemetry configured to export telemetry data, using either the Arconia OpenTelemetry Spring Boot Starter or the Spring Boot OpenTelemetry partial support (spring-boot-starter-opentelemetry). The recommended approach is the Arconia OpenTelemetry Spring Boot Starter:

  • Gradle

  • Maven

dependencies {
  implementation 'io.arconia:arconia-opentelemetry-spring-boot-starter'
}
<dependency>
    <groupId>io.arconia</groupId>
    <artifactId>arconia-opentelemetry-spring-boot-starter</artifactId>
</dependency>

Dev Service

During development and testing, you can use the Phoenix Dev Service to spin up a local Arize Phoenix instance automatically. Add the Dev Service dependency to your project:

  • Gradle

  • Maven

dependencies {
  testAndDevelopmentOnly "io.arconia:arconia-dev-services-phoenix"
}
<dependency>
    <groupId>io.arconia</groupId>
    <artifactId>arconia-dev-services-phoenix</artifactId>
    <scope>runtime</scope>
    <optional>true</optional>
</dependency>

When the Dev Service is active, Arconia configures OpenTelemetry automatically to export traces to Phoenix based on the OpenInference Semantic Conventions. No additional OTLP configuration is needed for local development.

Arize Phoenix

The Arconia integration guide in the Arize Phoenix documentation shows a complete example.

To send telemetry to a hosted Arize Phoenix instance, configure the OTLP exporter with your endpoint:

  • YAML

  • Properties

arconia:
  otel:
    exporter:
      otlp:
        endpoint: https://<your-phoenix-endpoint>
        headers:
          Authorization: Bearer ${PHOENIX_API_KEY}
arconia.otel.exporter.otlp.endpoint=https://<your-phoenix-endpoint>
arconia.otel.exporter.otlp.headers[Authorization]=Bearer ${PHOENIX_API_KEY}

Alternatively, you can use the standard OpenTelemetry environment variables:

OTEL_EXPORTER_OTLP_ENDPOINT=https://<your-phoenix-endpoint>
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <your-phoenix-api-key>"

You can also set the project name to control how traces are grouped in Phoenix:

  • YAML

  • Properties

arconia:
  observations:
    conventions:
      openinference:
        ai:
          project-name: my-app
arconia.observations.conventions.openinference.ai.project-name=my-app

The project name is the openinference.project.name resource attribute, which Arconia contributes through the resource support of the Arconia OpenTelemetry Spring Boot Starter, using the service name when the property is not set. With the Spring Boot OpenTelemetry support, set the resource attribute directly instead, otherwise Phoenix files the traces under its default project:

  • YAML

  • Properties

management:
  opentelemetry:
    resource-attributes:
      openinference.project.name: my-app
management.opentelemetry.resource-attributes.openinference.project.name=my-app

Since Phoenix only supports traces, you might want to disable the export of logs and metrics, or export them to a different backend:

  • YAML

  • Properties

arconia:
  otel:
    logs:
      exporter:
        type: none
    metrics:
      exporter:
        type: none
arconia.otel.logs.exporter.type=none
arconia.otel.metrics.exporter.type=none

Arize AX

The Arconia integration guide in the Arize AX documentation shows a complete example.

To send traces to Arize AX, configure the OTLP exporter with the Arize endpoint, the gRPC protocol, and the API key and space ID of your Arize AX space, defined in the ARIZE_API_KEY and ARIZE_SPACE_ID environment variables:

  • YAML

  • Properties

arconia:
  otel:
    exporter:
      otlp:
        protocol: grpc
        endpoint: https://otlp.arize.com:443
        headers:
          authorization: ${ARIZE_API_KEY}
          arize-space-id: ${ARIZE_SPACE_ID}
          arize-interface: java
arconia.otel.exporter.otlp.protocol=grpc
arconia.otel.exporter.otlp.endpoint=https://otlp.arize.com:443
arconia.otel.exporter.otlp.headers[authorization]=${ARIZE_API_KEY}
arconia.otel.exporter.otlp.headers[arize-space-id]=${ARIZE_SPACE_ID}
arconia.otel.exporter.otlp.headers[arize-interface]=java

Alternatively, you can use the standard OpenTelemetry environment variables:

OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.arize.com:443
OTEL_EXPORTER_OTLP_HEADERS="authorization=<your-arize-api-key>,arize-space-id=<your-arize-space-id>,arize-interface=java"

Exporting over gRPC requires additional dependencies, as described in the gRPC exporter documentation.

Arize AX files the traces under the project name configured as described for Phoenix. Since Arize AX also supports only traces, the same configuration to disable the export of logs and metrics applies.

Features

The module records OpenInference spans for:

  • Chat model calls, with the model, the parameters, the available tools, the input and output messages, and the token usage.

  • Embedding model calls, with the model and the input texts. Vectors are recorded as their dimension count, not their values.

  • Tool executions, with the arguments and the result.

  • Chat client calls, recorded as agents and grouped into sessions by the conversation ID of the chat memory.

  • Advisors, recorded as chains or guardrails.

Content is captured by default, following the OpenInference specification. Use the hide-* properties below to leave out what must not be recorded.

The captured content, such as prompts, completions, tool arguments and results, and tool definitions, can contain personal or confidential data. Review what your application sends to the models before exporting the telemetry to a shared backend, and turn the capturing off where that data must not leave the application.

The hide-* properties follow the OpenInference configuration. They also hide any other attribute carrying the same content, such as input.value when hiding the input messages, so Arconia sometimes hides more than the reference instrumentations.

Configuration Properties

You can configure the OpenInference Semantic Conventions via configuration properties.

Table 1. OpenInference Configuration Properties
Property Default Description

arconia.observations.conventions.openinference.ai.enabled

true

Whether to enable the OpenInference AI Semantic Conventions module.

arconia.observations.conventions.openinference.ai.project-name

-

Name of the project in the OpenInference backend where to send the telemetry data. If not set, the service.name resource attribute is used.

arconia.observations.conventions.openinference.ai.base64-image-max-length

32000

Maximum length of a base64-encoded media in the messages, such as an image or a document. Longer media are redacted.

arconia.observations.conventions.openinference.ai.hide-embeddings-text

false

Whether to hide all embedding text.

arconia.observations.conventions.openinference.ai.hide-embeddings-vectors

false

Whether to hide the dimension summary recorded in place of embedding vectors, which are never recorded.

arconia.observations.conventions.openinference.ai.hide-llm-invocation-parameters

false

Whether to hide the LLM invocation parameters.

arconia.observations.conventions.openinference.ai.hide-llm-tools

false

Whether to hide the definitions of the tools available to the model. They are also hidden when hiding all inputs.

arconia.observations.conventions.openinference.ai.hide-inputs

false

Whether to hide all inputs, including the input messages, the tool definitions, and the embedding text.

arconia.observations.conventions.openinference.ai.hide-input-images

false

Whether to hide all images from the input messages.

arconia.observations.conventions.openinference.ai.hide-input-messages

false

Whether to hide all input messages.

arconia.observations.conventions.openinference.ai.hide-input-text

false

Whether to hide all texts from the input messages.

arconia.observations.conventions.openinference.ai.hide-outputs

false

Whether to hide all outputs, including the output messages and the embedding vector summary.

arconia.observations.conventions.openinference.ai.hide-output-text

false

Whether to hide all texts from the output messages.

arconia.observations.conventions.openinference.ai.hide-output-messages

false

Whether to hide all output messages.

Environment Variables

Arconia supports the OpenInference Environment Variable Specification for configuring the OpenInference semantic conventions. If both the OpenInference Environment Variables and the Arconia configuration properties are set, the OpenInference Environment Variables will take precedence.

As in the OpenInference reference implementation, the boolean environment variables accept only true and false, in any case. Arconia logs a warning for any other value and ignores it, so the configuration property applies instead.

Environment Variable Configuration Property

OPENINFERENCE_BASE64_IMAGE_MAX_LENGTH

arconia.observations.conventions.openinference.ai.base64-image-max-length

OPENINFERENCE_HIDE_EMBEDDINGS_TEXT

arconia.observations.conventions.openinference.ai.hide-embeddings-text

OPENINFERENCE_HIDE_EMBEDDINGS_VECTORS

arconia.observations.conventions.openinference.ai.hide-embeddings-vectors

OPENINFERENCE_HIDE_LLM_INVOCATION_PARAMETERS

arconia.observations.conventions.openinference.ai.hide-llm-invocation-parameters

OPENINFERENCE_HIDE_LLM_TOOLS

arconia.observations.conventions.openinference.ai.hide-llm-tools

OPENINFERENCE_HIDE_INPUTS

arconia.observations.conventions.openinference.ai.hide-inputs

OPENINFERENCE_HIDE_INPUT_IMAGES

arconia.observations.conventions.openinference.ai.hide-input-images

OPENINFERENCE_HIDE_INPUT_MESSAGES

arconia.observations.conventions.openinference.ai.hide-input-messages

OPENINFERENCE_HIDE_INPUT_TEXT

arconia.observations.conventions.openinference.ai.hide-input-text

OPENINFERENCE_HIDE_OUTPUTS

arconia.observations.conventions.openinference.ai.hide-outputs

OPENINFERENCE_HIDE_OUTPUT_MESSAGES

arconia.observations.conventions.openinference.ai.hide-output-messages

OPENINFERENCE_HIDE_OUTPUT_TEXT

arconia.observations.conventions.openinference.ai.hide-output-text