conventions/OTelGenAiAttributes.java

langchain4j · langchain4j-micrometer-metrics/src/main/java/dev/langchain4j/micrometer/metrics/conventions/OTelGenAiAttributes.java · java · Apache-2.0
ai, tag:embed-classified

Enum of OpenTelemetry GenAI attribute keys for consistent telemetry instrumentation.

// Source: https://github.com/langchain4j/langchain4j | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package dev.langchain4j.micrometer.metrics.conventions;

public enum OTelGenAiAttributes {
    // GenAI General
    /**
     * The name of the operation being performed.
     */
    OPERATION_NAME("gen_ai.operation.name"),
    /**
     * The Generative AI provider as identified by the client or server instrumentation.
     */
    PROVIDER_NAME("gen_ai.provider.name"),

    // Token
    /**
     * The type of token that is counted: input, output, total.
     */
    TOKEN_TYPE("gen_ai.token.type"),

    // GenAI Request
    /**
     * The name of the model a request is being made to

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key