@yagni-app/code-staging 1.0.6-staging.1263.1 → 1.0.7-staging.1266.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -190,7 +190,10 @@ prefix instead of `claude_code`:
|
|
|
190
190
|
`gen_ai.usage.cache_read.input_tokens` and
|
|
191
191
|
`gen_ai.usage.cache_write.input_tokens` as subsets of it.
|
|
192
192
|
`gen_ai.cost.estimated_total` carries the same sell-rate cost as `cost_usd`
|
|
193
|
-
so vendor cost views work for the opaque tier id.
|
|
193
|
+
so vendor cost views work for the opaque tier id. It is an integer in
|
|
194
|
+
nanodollars (`cost_usd * 1e9`): Datadog reads that attribute unscaled into
|
|
195
|
+
its nanodollar cost metric, so a dollar value shows up a billion times too
|
|
196
|
+
small.
|
|
194
197
|
- **Metrics:** `yagni_code.session.count`, `token.usage` (by `type` and
|
|
195
198
|
`model`), `cost.usage`, `lines_of_code.count`, `commit.count`,
|
|
196
199
|
`pull_request.count`, `code_edit_tool.decision`, `active_time.total`.
|
|
@@ -52,7 +52,9 @@ export declare const ATTR_GEN_AI_CACHE_READ_TOKENS_LEGACY = "gen_ai.usage.cache_
|
|
|
52
52
|
export declare const ATTR_GEN_AI_CACHE_CREATION_TOKENS_LEGACY = "gen_ai.usage.cache_creation_input_tokens";
|
|
53
53
|
/** The one cost attribute Datadog's OTLP ingestion documents. Carries the
|
|
54
54
|
* same sell-rate figure as the flat `cost_usd`, so the vendor Cost view
|
|
55
|
-
* populates for the opaque tier id, which no vendor price table knows.
|
|
55
|
+
* populates for the opaque tier id, which no vendor price table knows.
|
|
56
|
+
* Unit is NANODOLLARS (integer), not dollars: Datadog copies the value
|
|
57
|
+
* unscaled into its nanodollar cost metric. */
|
|
56
58
|
export declare const ATTR_GEN_AI_COST_ESTIMATED_TOTAL = "gen_ai.cost.estimated_total";
|
|
57
59
|
export declare const ATTR_GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id";
|
|
58
60
|
export declare const ATTR_GEN_AI_AGENT_NAME = "gen_ai.agent.name";
|
|
@@ -54,7 +54,9 @@ export const ATTR_GEN_AI_CACHE_READ_TOKENS_LEGACY = "gen_ai.usage.cache_read_inp
|
|
|
54
54
|
export const ATTR_GEN_AI_CACHE_CREATION_TOKENS_LEGACY = "gen_ai.usage.cache_creation_input_tokens";
|
|
55
55
|
/** The one cost attribute Datadog's OTLP ingestion documents. Carries the
|
|
56
56
|
* same sell-rate figure as the flat `cost_usd`, so the vendor Cost view
|
|
57
|
-
* populates for the opaque tier id, which no vendor price table knows.
|
|
57
|
+
* populates for the opaque tier id, which no vendor price table knows.
|
|
58
|
+
* Unit is NANODOLLARS (integer), not dollars: Datadog copies the value
|
|
59
|
+
* unscaled into its nanodollar cost metric. */
|
|
58
60
|
export const ATTR_GEN_AI_COST_ESTIMATED_TOTAL = "gen_ai.cost.estimated_total";
|
|
59
61
|
export const ATTR_GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id";
|
|
60
62
|
export const ATTR_GEN_AI_AGENT_NAME = "gen_ai.agent.name";
|
|
@@ -301,8 +301,11 @@ export class SessionTelemetry {
|
|
|
301
301
|
span.setAttribute(ATTR_GEN_AI_CACHE_WRITE_TOKENS, cacheCreation);
|
|
302
302
|
span.setAttribute(ATTR_GEN_AI_CACHE_READ_TOKENS_LEGACY, cacheRead);
|
|
303
303
|
span.setAttribute(ATTR_GEN_AI_CACHE_CREATION_TOKENS_LEGACY, cacheCreation);
|
|
304
|
+
// Datadog ingests this attribute in nanodollars (its `ml_obs.span.llm.total.cost`
|
|
305
|
+
// unit); sending dollars renders a $0.012 call as 1.2e-9 cents. Verified against
|
|
306
|
+
// a live span on 2026-09-02. `cost_usd` below stays in dollars.
|
|
304
307
|
if (costKnown)
|
|
305
|
-
span.setAttribute(ATTR_GEN_AI_COST_ESTIMATED_TOTAL, cost);
|
|
308
|
+
span.setAttribute(ATTR_GEN_AI_COST_ESTIMATED_TOTAL, Math.round(cost * 1_000_000_000));
|
|
306
309
|
span.setAttribute("input_tokens", input);
|
|
307
310
|
span.setAttribute("output_tokens", output);
|
|
308
311
|
span.setAttribute("cache_read_tokens", cacheRead);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7-staging.1266.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "d1402054944b48117ac873cddd543c7ba14408a0"
|
|
62
62
|
}
|