spring-projects / spring-projects/spring-ai
Missing micrometer metrics for images
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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