spring-projects / spring-projects/spring-ai

Missing micrometer metrics for images

Open
#6,799 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 7h
Merged PRs (30d)
6

Description

Bug description
Creating images with any model produces logs, but no micrometer metrics

Environment
Spring AI version: latest
Java version: java 17

Steps to reproduce
Create image with any ImageModel

Expected behavior
Metrics described in observability docs should be produced, in particular "gen_ai.client.token.usage" with "genai_operation.name" as "image"

Minimal Complete Reproducible example
ImageResponse response = openaiImageModel.call(
new ImagePrompt("A light cream colored mini golden doodle",
OpenAiImageOptions.builder()
.quality("hd")
.n(4)
.height(1024)
.width(1024).build())

);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ImageModel call shown in the reproduction and compare its behavior with the observability documentation linked in the issue. Verify whether image creation emits the expected Micrometer metrics, especially gen_ai.client.token.usage with genai_operation.name set to image; done means those metrics are produced for image requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.