ImageMetrics

org.llm4s.imagegeneration.ImageMetrics
@Experimental
object ImageMetrics

The metrics InstrumentedImageGenerationClient records, declared as Metrics and recorded through MetricsCollector.increment and MetricsCollector.observe, so every backend that exports generic metrics exports them, and core names nothing about image generation (#2801). They were two methods of MetricsCollector, observeImageGeneration and recordImageGenerationCost.

The exported series are the ones those methods produced. A Prometheus backend exposes them as llm4s_image_generations_total, llm4s_images_generated_total, llm4s_image_generation_duration_seconds, llm4s_image_generation_cost_usd_total and llm4s_image_generation_errors_total; a Micrometer one under the names below. ImageMetricsSeriesSpec pins every name, type, label and bucket.

A failed operation is also added to MetricsCollector.Errors (llm4s_errors_total), the count of failed operations a backend keeps for every kind of request.

Attributes

Source
ImageMetrics.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def statusLabel(outcome: Outcome): String

The status label of Generations for outcome: success, or error_rate_limit and the like.

The status label of Generations for outcome: success, or error_rate_limit and the like.

Attributes

Source
ImageMetrics.scala

Concrete fields

Estimated cost of the images generated, in USD. Labels: provider, model.

Estimated cost of the images generated, in USD. Labels: provider, model.

Attributes

Source
ImageMetrics.scala

How long each operation took, successful or not. Labels: provider, model, operation.

How long each operation took, successful or not. Labels: provider, model, operation.

Attributes

Source
ImageMetrics.scala

Failed image generation operations. Labels: provider, model, operation, error_type (an ErrorKind, in snake case).

Failed image generation operations. Labels: provider, model, operation, error_type (an ErrorKind, in snake case).

Attributes

Source
ImageMetrics.scala

Image generation operations, successful or not. Labels: provider, model, operation (generate or edit), status (success, or error_ and the error type: see statusLabel).

Image generation operations, successful or not. Labels: provider, model, operation (generate or edit), status (success, or error_ and the error type: see statusLabel).

Attributes

Source
ImageMetrics.scala

Images generated by successful operations. Labels: provider, model.

Images generated by successful operations. Labels: provider, model.

Attributes

Source
ImageMetrics.scala