View Source OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics (OpenTelemetry.SemConv v1.27.0)

OpenTelemetry Semantic Conventions for Gen_Ai metrics.

Summary

Functions

GenAI operation duration

Measures number of input and output tokens used

Generative AI server request duration such as time-to-last byte or last output token

Time per output token generated after the first token for successful responses

Time to generate first token for successful responses

Functions

Link to this function

gen_ai_client_operation_duration()

View Source
@spec gen_ai_client_operation_duration() :: :"gen_ai.client.operation.duration"

GenAI operation duration

Instrument: histogram
Unit: s

iex> OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics.gen_ai_client_operation_duration()
:"gen_ai.client.operation.duration"
Link to this function

gen_ai_client_token_usage()

View Source
@spec gen_ai_client_token_usage() :: :"gen_ai.client.token.usage"

Measures number of input and output tokens used

Instrument: histogram
Unit: {token}

iex> OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics.gen_ai_client_token_usage()
:"gen_ai.client.token.usage"
Link to this function

gen_ai_server_request_duration()

View Source
@spec gen_ai_server_request_duration() :: :"gen_ai.server.request.duration"

Generative AI server request duration such as time-to-last byte or last output token

Instrument: histogram
Unit: s

iex> OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics.gen_ai_server_request_duration()
:"gen_ai.server.request.duration"
Link to this function

gen_ai_server_time_per_output_token()

View Source
@spec gen_ai_server_time_per_output_token() :: :"gen_ai.server.time_per_output_token"

Time per output token generated after the first token for successful responses

Instrument: histogram
Unit: s

iex> OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics.gen_ai_server_time_per_output_token()
:"gen_ai.server.time_per_output_token"
Link to this function

gen_ai_server_time_to_first_token()

View Source
@spec gen_ai_server_time_to_first_token() :: :"gen_ai.server.time_to_first_token"

Time to generate first token for successful responses

Instrument: histogram
Unit: s

iex> OpenTelemetry.SemConv.Incubating.Metrics.GenAiMetrics.gen_ai_server_time_to_first_token()
:"gen_ai.server.time_to_first_token"