Skip to content

feat(ai): Add gen_ai_cost_total_tokens field and deprecate old version - #126

Merged
vgrozdanic merged 3 commits into
mainfrom
vg/new-cost-attr
Sep 9, 2025
Merged

vgrozdanic merged 3 commits into
mainfrom
vg/new-cost-attr

Conversation

@vgrozdanic

@vgrozdanic vgrozdanic commented Sep 8, 2025 •

Copy link
Copy Markdown
Member

Introduce gen_ai_cost_total_tokens and double write total tokens cost to it and to gen_ai_usage_total_cost for the next 90 days (until the data expires).

After that the plan is to completely deprecate gen_ai_usage_total_cost field to have all the cost related fields under gen_ai.cost.*.

Part of TET-1100: Update relay and conventions to reduce work scattering

@vgrozdanic
vgrozdanic requested a review from a team September 8, 2025 08:41
@linear

linear Bot commented Sep 8, 2025

Copy link
Copy Markdown

*
* Attribute defined in OTEL: No
*
* @deprecated Use {@link GEN_AI_COST_TOTAL_TOKENS} (gen_ai.cost.total_tokens) instead

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the associated type GEN_AI_USAGE_TOTAL_COST_TYPE also be marked as deprecated?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, we should also mark the associated types as deprecated during code generation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only changed json file, everything else was generated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lcian is that something that needs to be changed in the generation script, or in this PR?

Even if i change it now, and someone re-generates attributes.ts, that will be overwritten, right?

@lcian lcian Sep 9, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep the logic needs to be changed in the generation script.
You should only touch the JSONs inside model/, everything else is generated.

@shellmayr shellmayr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@vgrozdanic
vgrozdanic merged commit 50c1b9b into main Sep 9, 2025
@vgrozdanic
vgrozdanic deleted the vg/new-cost-attr branch September 9, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants