Repository navigation
fix(ai-monitoring): Add dashed and dotted spellings of model versions - #133197
Closed
sentry-junior[bot] wants to merge 1 commit into
Closed
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Model ids spell the same version as claude-opus-5.5 or claude-opus-5-5. When the price feeds listed only one spelling, spans that reported the other found no price, so their costs, including cache reads, were 0. Each metadata name now also gets the other spelling, without replacing a name that already exists. Refs CW-1897 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
Contributor
Author
|
Closing this in favor of getsentry/relay#6808, which fixes CW-1897 on the Relay side. Relay now tries the other version spelling ( No Sentry-side alias is needed in the meantime. Sentry's processing Relays deploy from master and self-hosted ships a matching Relay, so the fix reaches cost calculation when getsentry/relay#6808 deploys. An older external Relay that computes costs itself keeps today's behavior until it upgrades. That isn't a regression. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Model ids spell the same version two ways:
claude-opus-5.5(Anthropic API, OpenRouter) andclaude-opus-5-5(Bedrock, some models.dev providers)._add_glob_model_namesonly added the normalized name and its*glob. So when the price feeds listed one spelling and a span reported the other, Relay found no price, and that span's costs, cache reads included, came out as 0.Each name in the metadata, including the
*globs, now also gets the other spelling of single-digit versions:claude-opus-5.5↔claude-opus-5-5. A name that already exists keeps its own price. Many models are listed in both spellings at different prices by different providers, so nothing is replaced. Dates and longer numbers are not touched (o3-pro-2025-06-10gets no dotted alias).This doesn't add a flat cache-price fallback: cache-read multipliers differ by model, so a missing price stays missing instead of being guessed.
Relay needs no change.
ModelMetadata::getnormalizes the reported id, tries an exact key, then the*globs, so it finds either spelling once both are in the metadata.Open decision, payload size: with today's public OpenRouter and models.dev feeds, the
aiModelMetadatamap in Relay's global config grows by about 40% (key count and JSON size). Two smaller options:*glob aliases. Relay still matches both spellings through its glob fallback, and growth drops to about 20%. Exact-key lookups for the other spelling would go through the slower glob scan.normalize_ai_model_namelookup (try the dashed form on a miss). No growth, but it needs a Relay release.Refs CW-1897
via @BYK.
--
View Session [Sentry]