Revert "feat(stats): add user ids to inference metrics"
This reverts commit 428ae6d21a.
This commit is contained in:
parent
428ae6d21a
commit
e0ff4fd1ac
6 changed files with 10 additions and 62 deletions
|
|
@ -697,7 +697,6 @@ export async function handler(
|
|||
logger.metric({
|
||||
api_key: data.apiKey,
|
||||
workspace: data.workspaceID,
|
||||
user_id: data.user.id,
|
||||
...(() => {
|
||||
if (data.billing.subscription)
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ function toLakeEvent(time: string, data: Record<string, unknown>) {
|
|||
error_cause2: string(data, "error.cause2"),
|
||||
api_key: string(data, "api_key"),
|
||||
workspace: string(data, "workspace"),
|
||||
user_id: string(data, "user_id"),
|
||||
is_subscription: boolean(data, "isSubscription"), // removed
|
||||
subscription: string(data, "subscription"),
|
||||
response_length: integer(data, "response_length"),
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ WITH normalized AS (
|
|||
session,
|
||||
COALESCE(NULLIF(workspace, ''), '') AS workspace,
|
||||
COALESCE(NULLIF(api_key, ''), '') AS api_key,
|
||||
COALESCE(NULLIF(user_id, ''), '') AS user_id,
|
||||
status,
|
||||
duration AS duration_ms,
|
||||
time_to_first_byte AS ttfb_ms,
|
||||
|
|
@ -117,7 +116,7 @@ WITH normalized AS (
|
|||
country,
|
||||
continent,
|
||||
session,
|
||||
COALESCE(NULLIF(user_id, ''), NULLIF(workspace, ''), NULLIF(api_key, '')) AS user_key,
|
||||
COALESCE(NULLIF(workspace, ''), NULLIF(api_key, '')) AS user_key,
|
||||
status,
|
||||
duration_ms,
|
||||
ttfb_ms,
|
||||
|
|
|
|||
|
|
@ -454,11 +454,7 @@ function baseAggregate(row: RawRow, grain: Grain, opts: ImportOptions): StatBase
|
|||
tier: tier(row),
|
||||
sessions: integer(row, "sessions", ["COUNT_DISTINCT(session)"]),
|
||||
requests: integer(row, "requests", ["COUNT", "COUNT()"]),
|
||||
unique_users: integer(row, "unique_users", [
|
||||
"COUNT_DISTINCT(user_id)",
|
||||
"COUNT_DISTINCT(workspace)",
|
||||
"COUNT_DISTINCT(api_key)",
|
||||
]),
|
||||
unique_users: integer(row, "unique_users", ["COUNT_DISTINCT(workspace)", "COUNT_DISTINCT(api_key)"]),
|
||||
input_tokens: integer(row, "input_tokens", ["SUM(tokens.input)", "SUM(tokens_input)"]),
|
||||
output_tokens: integer(row, "output_tokens", ["SUM(tokens.output)", "SUM(tokens_output)"]),
|
||||
reasoning_tokens: integer(row, "reasoning_tokens", ["SUM(tokens.reasoning)", "SUM(tokens_reasoning)"]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue