1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6427],{24737:(e,t,s)=>{s.d(t,{aR:()=>l,l8:()=>o});var i=s(41454),a=s(45596);i.z.object({name:i.z.string(),description:i.z.string(),baseCte:i.z.string(),dimensions:i.z.record(i.z.string(),i.z.object({sql:i.z.string(),alias:i.z.string().optional(),relationTable:i.z.string().optional(),description:i.z.string().optional(),type:i.z.string().optional(),unit:i.z.string().optional(),aggregationFunction:i.z.string().optional(),highCardinality:i.z.boolean().optional(),explodeArray:i.z.boolean().optional(),pairExpand:i.z.object({valuesSql:i.z.string(),valueAlias:i.z.string()}).optional()})),measures:i.z.record(i.z.string(),i.z.object({sql:i.z.string(),alias:i.z.string().optional(),relationTable:i.z.string().optional(),description:i.z.string().optional(),type:i.z.string().optional(),unit:i.z.string().optional(),aggs:i.z.record(i.z.string(),i.z.string()).optional(),requiresDimension:i.z.string().optional()})),tableRelations:i.z.record(i.z.string(),i.z.object({name:i.z.string(),joinConditionSql:i.z.string(),timeDimension:i.z.string()})),segments:i.z.array(a.singleFilter),timeDimension:i.z.string(),rootEventCondition:i.z.object({column:i.z.string(),condition:i.z.string()}).optional()});let n=i.z.string().datetime({offset:!0}),o=i.z.enum(["traces","observations","scores-numeric","scores-categorical"]);i.z.enum(["observations","scores-numeric","scores-categorical"]),i.z.enum(["v
11","v2"]);let r=i.z.object({field:i.z.string()}),l=i.z.enum(["sum","avg","count","max","min","p50","p75","p90","p95","p99","histogram","uniq"]),c=i.z.object({measure:i.z.string(),aggregation:l}),m=i.z.enum(["auto","minute","hour","day","week","month"]);i.z.object({view:o,dimensions:i.z.array(r),metrics:i.z.array(c),filters:i.z.array(a.singleFilter),timeDimension:i.z.object({granularity:m}).nullable(),fromTimestamp:n,toTimestamp:n,orderBy:i.z.array(i.z.object({field:i.z.string(),direction:i.z.enum(["asc","desc"])})).nullable(),chartConfig:i.z.object({type:i.z.string(),bins:i.z.number().int().min(1).max(100).optional(),row_limit:i.z.number().int().positive().lte(1e3).optional()}).optional()}).refine(e=>new Date(e.fromTimestamp)<new Date(e.toTimestamp)),i.z.union([i.z.literal("true"),i.z.literal("false"),i.z.boolean()]).optional().transform(e=>"true"===e||!0===e)},26159:(e,t,s)=>{s.d(t,{A:()=>o});var i=s(73154),a=s(49757),n=s(81509);let o=e=>{let{children:t,headerProps:s,scrollable:o=!1,withPadding:r=!1}=e;return(0,i.jsxs)("div",{className:(0,n.cn)("flex flex-col",o?"relative flex min-h-screen-with-banner flex-1":"h-full"),id:"page","data-sentry-component":"Page","data-sentry-source-file":"page.tsx",children:[(0,i.jsx)("header",{className:"sticky top-0 z-50 w-full",children:(0,i.jsx)(a.A,{...s,container:!1,className:"top-0","data-sentry-element":"PageHeader","data-sentry-source-file":"page.tsx"})}),(0,i.jsx)("main",{className:(0,n.cn)("flex flex-1 flex-col",o?"relative flex min-h-screen-with-banner":"h-full overflow-hidden",r&&"p-3"),children:t})]})}},30969:(e,t,s)=>{s.d(t,{Qg:()=>o,aR:()=>r.aR}),s(60517);var i=s(41454),a=s(45596);i.z.array(a.singleFilter);let n={traces:[{uiTableName:"Trace Name",viewName:"name"},{uiTableName:"Observation Name",viewName:"observationName"},{uiTableName:"Score Name",viewName:"scoreName"},{uiTableName:"Tags",viewName:"tags"},{uiTableName:"User",viewName:"userId"},{uiTableName:"Session",viewName:"sessionId"},{uiTableName:"Metadata",viewName:"metadata"},{uiTableName:"Release",viewName:"release"},{uiTableName:"Version",viewName:"version"},{uiTableName:"Environment",viewName:"environment"}],observations:[{uiTableName:"Trace Name",viewName:"traceName"},{uiTableName:"Observation Name",viewName:"name"},{uiTableName:"Score Name",viewName:"scoreName"},{uiTableName:"User",viewName:"userId"},{uiTableName:"Session",viewName:"sessionId"},{uiTableName:"Metadata",viewName:"metadata"},{uiTableName:"Type",viewName:"type"},{uiTableName:"Tags",viewName:"tags"},{uiTableName:"Model",viewName:"providedModelName"},{uiTableName:"Tool Names",viewName:"toolNames"},{uiTableName:"Environment",viewName:"environment"},{uiTableName:"Release",viewName:"traceRelease"},{uiTableName:"Version",viewName:"traceVersion"}],"scores-numeric":[{uiTableName:"Score Name",viewName:"name"},{uiTableName:"Score Source",viewName:"source"},{uiTableName:"Score Value",viewName:"value"},{uiTableName:"value",viewName:"value"},{uiTableName:"Scores Data Type",viewName:"dataType"},{uiTableName:"Tags",viewName:"tags"},{uiTableName:"Environment",viewName:"environment"},{uiTableName:"User",viewName:"userId"},{uiTableName:"Session",viewName:"sessionId"},{uiTableName:"Metadata",viewName:"metadata"},{uiTableName:"Trace Name",viewName:"traceName"},{uiTableName:"Observation Name",viewName:"observationName"},{uiTableName:"Release",viewName:"traceRelease"},{uiTableName:"Version",viewName:"traceVersion"}],"scores-categorical":[{uiTableName:"Score Name",viewName:"name"},{uiTableName:"Score Source",viewName:"source"},{uiTableName:"Score String Value",viewName:"stringValue"},{uiTableName:"Scores Data Type",viewName:"dataType"},{uiTableName:"Tags",viewName:"tags"},{uiTableName:"Environment",viewName:"environment"},{uiTableName:"User",viewName:"userId"},{uiTableName:"Session",viewName:"sessionId"},{uiTableName:"Metadata",viewName:"metadata"},{uiTableName:"Trace Name",viewName:"traceName"},{uiTableName:"Observation Name",viewName:"observationName"},{uiTableName:"Release",viewName:"traceRelease"},{uiTableName:"Version",viewName:"traceVersion"}]},o=(e,t)=>t.flatMap(t=>{if(!a.dashboardColumnDefinitions.concat([{uiTableName:"Session",uiTableId:"sessionId",clickhouseTableName:"traces",clickhouseSelect:'t."sessionId"'},{uiTableName:"Observation Name",uiTableId:"observationName",clickhouseTableName:"observations",clickhouseSelect:'o."name"'},{uiTableName:"Metadata",uiTableId:"metadata",clickhouseTableName:"traces",clickhouseSelect:'t."metadata"'},{uiTableName:"Score Value",uiTableId:"value",clickhouseTableName:"scores",clickhouseSelect:'s."value"'},{uiTableName:"Score String Value",uiTableId:"stringValue",clickhouseTableName:"scores",clickhouseSelect:'s."string_value"'}]).some(e=>e.uiTableName===t.column))return[t];let s=n[e].find(e=>e.uiTableName===t.column);return s?[{...t,column:s.viewName}]:[]});var r=s(24737)},60430:(e,t,s)=>{s.d(t,{D:()=>o});var i=s(6300),a=s(8277),n=s(96810);function o(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=null!=(e=t.defaultRelativeAggregation)?e:a.t8,[o,r]=(0,i.useQueryParams)({dateRange:(0,i.withDefault)(i.StringParam,(0,a.qE)(s))});return(0,n.useMemo)(()=>({timeRange:(0,a.JR)(o.dateRange,a.P6,s),setTimeRange:e=>{r({dateRange:(0,a.gG)(e)})}}),[o.dateRange,s,r])}},60517:(e,t,s)=>{s.d(t,{vZ:()=>p}),s(45596);let i={traceName:{sql:"traces.name",alias:"traceName",type:"string",relationTable:"traces",description:"Name of the parent trace."},tags:{sql:"traces.tags",alias:"tags",type:"string[]",relationTable:"traces",description:"User-defined tags associated with the trace."},userId:{sql:"traces.user_id",alias:"userId",type:"string",relationTable:"traces",description:"Identifier of the user triggering the trace."},sessionId:{sql:"traces.session_id",alias:"sessionId",type:"string",relationTable:"traces",description:"Identifier of the session triggering the trace."},traceRelease:{sql:"traces.release",alias:"traceRelease",type:"string",relationTable:"traces",description:"Release version of the parent trace."},traceVersion:{sql:"traces.version",alias:"traceVersion",type:"string",relationTable:"traces",description:"Version of the parent trace."},observationName:{sql:"observations.name",alias:"observationName",type:"string",relationTable:"observations",description:"Name of the observation associated with the score."},observationModelName:{sql:"observations.provided_model_name",alias:"observationModelName",type:"string",relationTable:"observations",description:"Name of the model used for the observation."},observationPromptName:{sql:"observations.prompt_name",alias:"observationPromptName",type:"string",relationTable:"observations",description:"Name of the prompt used for the observation."},observationPromptVersion:{sql:"observations.prompt_version",alias:"observationPromptVersion",type:"string",relationTable:"observations",description:"Version of the prompt used for the observation."}},a={sessionId:{sql:"scores.session_id",alias:"sessionId",type:"string",description:"Identifier of the session.",highCardinality:!0},traceName:{sql:"nullIf(events_traces.trace_name, '')",alias:"traceName",type:"string",relationTable:"events_traces",description:"Name of the parent trace."},userId:{sql:"nullIf(events_traces.user_id, '')",alias:"userId",type:"string",relationTable:"events_traces",description:"Identifier of the user.",highCardinality:!0},tags:{sql:"events_traces.tags",alias:"tags",type:"string[]",relationTable:"events_traces",description:"User-defined tags."},traceRelease:{sql:"nullIf(events_traces.release, '')",alias:"traceRelease",type:"string",relationTable:"events_traces",description:"Release version."},traceVersion:{sql:"nullIf(events_traces.version, '')",alias:"traceVersion",type:"string",relationTable:"events_traces",description:"Version of the parent trace."},observationName:{sql:"events_observations.name",alias:"observationName",type:"string",relationTable:"events_observations",description:"Name of the observation associated with the score."},observationModelName:{sql:"nullIf(events_observations.provided_model_name, '')",alias:"observationModelName",type:"string",relationTable:"events_observations",description:"Name of the model used for the observation."},observationPromptName:{sql:"nullIf(events_observations.prompt_name, '')",alias:"observationPromptName",type:"string",relationTable:"events_observations",description:"Name of the prompt used for the observation."},observationPromptVersion:{sql:"events_observations.prompt_version",alias:"observationPromptVersion",type:"string",relationTable:"events_observations",description:"Version of the prompt used for the observation."}},n=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{id:{sql:"".concat(e,".id"),alias:"id",type:"string",description:"Unique identifier of the score entry.",...t&&{highCardinality:!0}},environment:{sql:"".concat(e,".environment"),alias:"environment",type:"string",description:"Deployment environment (e.g., production, staging)."},name:{sql:"".concat(e,".name"),alias:"name",type:"string",description:"Name of the score (e.g., accuracy, toxicity)."},source:{sql:"".concat(e,".source"),alias:"source",type:"string",description:"Origin of the score. Can be API, ANNOTATION, or EVAL."},dataType:{sql:"".concat(e,".data_type"),alias:"dataType",type:"string",description:"Internal data type of the score (NUMERIC, BOOLEAN, CATEGORICAL)."},traceId:{sql:"".concat(e,".trace_id"),alias:"traceId",type:"string",description:"Identifier of the parent trace.",...t&&{highCardinality:!0}},configId:{sql:"".concat(e,".config_id"),alias:"configId",type:"string",description:"Identifier of the config associated with the score."},timestampMonth:{sql:"formatDateTime(".concat(e,".timestamp, '%Y-%m')"),alias:"timestampMonth",type:"string",description:"Month of the score timestamp in YYYY-MM format."},timestampDay:{sql:"formatDateTime(".concat(e,".timestamp, '%Y-%m-%d')"),alias:"timestampDay",type:"string",description:"Day of the score timestamp in YYYY-MM-DD format."},observationId:{sql:"".concat(e,".observation_id"),alias:"observationId",type:"string",description:"Identifier of the observation associated with the score.",...t&&{highCardinality:!0}}}},o=e=>"v1"===e?{traces:{name:"traces",joinConditionSql:"ON scores.trace_id = traces.id AND scores.project_id = traces.project_id",t
1imeDimension:"timestamp"},observations:{name:"observations",joinConditionSql:"ON scores.observation_id = observations.id AND scores.project_id = observations.project_id",timeDimension:"start_time"}}:{events_traces:{name:"events_core",joinConditionSql:"ON scores.trace_id = events_traces.trace_id AND scores.project_id = events_traces.project_id AND events_traces.parent_span_id = ''",timeDimension:"start_time"},events_observations:{name:"events_core",joinConditionSql:"ON scores.project_id = events_observations.project_id AND scores.trace_id = events_observations.trace_id AND scores.observation_id = events_observations.span_id",timeDimension:"start_time"}};function r(e){return{name:"scores_numeric",description:"Scores are flexible objects that are used for evaluations. This view contains numeric and boolean scores.",dimensions:{..."v1"===e?i:a,...n("scores_numeric","v2"===e),value:{sql:"scores_numeric.value",alias:"value",type:"number",description:"Value of the score."}},measures:{count:{sql:"count(*)",alias:"count",type:"integer",description:"Total number of scores.",unit:"scores"},value:{sql:"any(value)",alias:"value",type:"number",description:"Value of the score."}},tableRelations:o(e),segments:[{column:"data_type",operator:"does not contain",value:"CATEGORICAL",type:"string"}],timeDimension:"timestamp",baseCte:"scores scores_numeric FINAL"}}function l(e){return{name:"scores_categorical",description:"Scores are flexible objects that are used for evaluations. This view contains categorical scores.",dimensions:{..."v1"===e?i:a,...n("scores_categorical","v2"===e),stringValue:{sql:"string_value",alias:"stringValue",type:"string",description:"Value of the score."}},measures:{count:{sql:"count(*)",alias:"count",type:"integer",description:"Total number of scores.",unit:"scores"}},tableRelations:o(e),segments:[{column:"data_type",operator:"=",value:"CATEGORICAL",type:"string"}],timeDimension:"timestamp",baseCte:"scores scores_categorical FINAL"}}let c=r("v1"),m=l("v1"),d=r("v2"),p={v1:{traces:{name:"traces",description:"Traces represent a group of observations and typically represent a single request or operation.",dimensions:{id:{sql:"traces.id",alias:"id",type:"string",description:"Unique identifier of the trace."},name:{sql:"traces.name",alias:"name",type:"string",description:"Name assigned to the trace (often the endpoint or operation)."},tags:{sql:"traces.tags",alias:"tags",type:"string[]",description:"User-defined tags associated with the trace."},userId:{sql:"traces.user_id",alias:"userId",type:"string",description:"Identifier of the user triggering the trace."},sessionId:{sql:"traces.session_id",alias:"sessionId",type:"string",description:"Identifier of the session triggering the trace."},release:{sql:"traces.release",alias:"release",type:"string",description:"Release version of the trace."},version:{sql:"traces.version",alias:"version",type:"string",description:"Version of the trace."},environment:{sql:"traces.environment",alias:"environment",type:"string",description:"Deployment environment (e.g., production, staging)."},timestampMonth:{sql:"formatDateTime(traces.timestamp, '%Y-%m')",alias:"timestampMonth",type:"string",description:"Month of the trace timestamp in YYYY-MM format."}},measures:{count:{sql:"count(*)",alias:"count",type:"integer",description:"Total number of traces.",unit:"traces"},observationsCount:{sql:"uniq(observations.id)",alias:"observationsCount",type:"integer",relationTable:"observations",description:"Unique observations linked to the trace.",unit:"observations"},scoresCount:{sql:"uniq(scores.id)",alias:"scoresCount",type:"integer",relationTable:"scores",description:"Unique scores attached to the trace.",unit:"scores"}
1,uniqueUserIds:{sql:"uniq(traces.user_id)",alias:"uniqueUserIds",type:"integer",description:"Count of unique userIds.",unit:"users"},uniqueSessionIds:{sql:"uniq(traces.session_id)",alias:"uniqueSessionIds",type:"integer",description:"Count of unique sessionIds.",unit:"sessions"},latency:{sql:"date_diff('millisecond', min(observations.start_time), max(observations.end_time))",alias:"latency",type:"integer",relationTable:"observations",description:"Elapsed time between the first and last observation inside the trace.",unit:"millisecond"},totalTokens:{sql:"sumMap(observations.usage_details)['total']",alias:"totalTokens",type:"integer",relationTable:"observations",description:"Sum of tokens consumed by all observations in the trace.",unit:"tokens"},totalCost:{sql:"sum(observations.total_cost)",alias:"totalCost",type:"decimal",relationTable:"observations",description:"Total cost accumulated across observations in the trace.",unit:"USD"}},tableRelations:{observations:{name:"observations",joinConditionSql:"ON traces.id = observations.trace_id AND traces.project_id = observations.project_id",timeDimension:"start_time"},scores:{name:"scores",joinConditionSql:"ON traces.id = scores.trace_id AND traces.project_id = scores.project_id",timeDimension:"timestamp"}},segments:[],timeDimension:"timestamp",baseCte:"traces FINAL"},observations:{name:"observations",description:"Observations represent individual requests or operations within a trace. They are grouped into Spans, Generations, and Events.",dimensions:{id:{sql:"observations.id",alias:"id",type:"string",description:"Unique identifier for the observation."},traceId:{sql:"observations.trace_id",alias:"traceId",type:"string",description:"Identifier linking the observation to its parent trace."},traceName:{sql:"traces.name",alias:"traceName",type:"string",relationTable:"traces",description:"Name of the parent trace."},environment:{sql:"observations.environment",alias:"environment",type:"string",description:"Deployment environment (e.g., production, staging)."},parentObservationId:{sql:"observations.parent_observation_id",alias:"parentObservationId",type:"string",description:"Identifier of the parent observation. Empty for the root span."},type:{sql:"observations.type",alias:"type",type:"string",description:"Type of the observation. Can be a SPAN, GENERATION, or EVENT."},name:{sql:"observations.name",alias:"name",type:"string",description:"Name of the observation."},level:{sql:"observations.level",alias:"level",type:"string",description:"Logging level of the observation."},version:{sql:"observations.version",alias:"version",type:"string",description:"Version of the observation."},tags:{sql:"traces.tags",alias:"tags",type:"string[]",relationTable:"traces",description:"User-defined tags associated with the trace."},providedModelName:{sql:"observations.provided_model_name",alias:"providedModelName",type:"string",description:"Name of the model used for the observation."},promptName:{sql:"observations.prompt_name",alias:"promptName",type:"string",description:"Name of the prompt used for the observation."},promptVersion:{sql:"observations.prompt_version",alias:"promptVersion",type:"string",description:"Version of the prompt used for the observation."},userId:{sql:"traces.user_id",alias:"userId",type:"string",relationTable:"traces",description:"Identifier of the user triggering the observation."},sessionId:{sql:"traces.session_id",alias:"sessionId",type:"string",relationTable:"traces",description:"Identifier of the session triggering the observation."},traceRelease:{sql:"traces.release",alias:"traceRelease",type:"string",relationTable:"traces",description:"Release version of the parent trace."},traceVersion:{sql:"traces.version",alias:"traceVersion",type:"string",relationTable:"traces",description:"Version of the parent trace."},startTimeMonth:{sql:"formatDateTime(observations.start_time, '%Y-%m')",alias:"startTimeMonth",type:"string",description:"Month of the observation start_time in YYYY-MM format."},toolNames:{sql:"mapKeys(observations.tool_definitions)",alias:"toolNames",type:"arrayString",description:"Names of available tools defined for the observation.",explodeArray:!0},calledToolNames:{sql:"observations.tool_call_names",alias:"calledToolNames",type:"arrayString",description:"Names of tools that were called by the observation.",explodeArray:!0}},measures:{count:{sql:"@@AGG@@(1)",aggs:{agg:"count"},alias:"count",type:"integer",description:"Total number of observations.",unit:"observations"},latency:{sql:"date_diff('millisecond', @@AGG1@@(observations.start_time), @@AGG1@@(observations.end_time))",aggs:{agg1:"any"},alias:"latency",type:"integer",description:"Latency of an individual observation (start time to end time).",unit:"millisecond"},streamingLatency:{sql:"if(isNull(@@AGG1@@(observations.completion_start_time)), CAST(NULL AS Nullable(Int64)), date_diff('millisecond', @@AGG1@@(observations.completion_start_time), @@AGG1@@(observations.end_time)))",aggs:{agg1:"any"},alias:"streamingLatency",type:"integer",description:"Latency of the generation step (completion start time to end time).",unit:"millisecond"},inputTokens:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'input') > 0, @@AGG1@@(usage_details))))",aggs:{agg1:"any"},alias:"inputTokens",type:"integer",description:"Sum of input tokens consumed by the observation.",unit:"tokens"},outputTokens:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(usage_details))))",aggs:{agg1:"any"},alias:"outputTokens",type:"integer",description:"Sum of output tokens produced by the observation.",unit:"tokens"},totalTokens:{sql:"@@AGG1@@(usage_details)['total']",aggs:{agg1:"sumMap"},alias:"totalTokens",type:"integer",description:"Sum of tokens consumed by the observation.",unit:"tokens"},outputTokensPerSecond:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(usage_details)))) / nullIf(date_diff('second', @@AGG1@@(observations.completion_start_time), @@AGG1@@(observations.end_time)), 0)",aggs:{agg1:"any"},alias:"outputTokensPerSecond",type:"decimal",description:"Average number of output tokens produced per second between completion start time and span end time.",unit:"tokens/s"},tokensPerSecond:{sql:"@@AGG1@@(usage_details)['total'] / nullIf(date_diff('second', @@AGG2@@(observations.start_time), @@AGG2@@(observations.end_time)), 0)",aggs:{agg1:"sumMap",agg2:"any"},alias:"tokensPerSecond",type:"decimal",description:"Average number of tokens consumed per second by the observation.",unit:"tokens/s"},inputCost:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'input') > 0, @@AGG1@@(cost_details))))",aggs:{agg1:"any"},alias:"inputCost",type:"decimal",description:"Sum of input cost incurred by the observation.",unit:"USD"},outputCost:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(cost_details))))",aggs:{agg1:"any"},alias:"outputCost",type:"decimal",description:"Sum of output cost incurred by the observation.",unit:"USD"},totalCost:{sql:"@@AGG1@@(total_cost)",aggs:{agg1:"sum"},alias:"totalCost",type:"decimal",description:"Total cost incurred by the observation.",unit:"USD"},timeToFirstToken:{sql:"if(isNull(@@AGG1@@(observations.completion_start_time)), CAST(NULL AS Nullable(Int64)), date_diff('millisecond', @@AGG1@@(observations.start_time), @@AGG1@@(observations.completion_start_time)))",aggs:{agg1:"any"},alias:"timeToFirstToken",type:"integer",description:"Time to first token for the observation.",unit:"millisecond"},countScores:{sql:"uniq(scores.id)",alias:"countScores",type:"integer",relationTable:"scores",description:"Unique scores attached to the observation.",unit:"scores"},toolDefinitions:{sql:"nullIf(length(mapKeys(@@AGG1@@(tool_definitions))), 0)",aggs:{agg1:"any"},alias:"toolDefinitions",type:"integer",description:"Number of available tools per observation.",unit:"tools"},toolCalls:{sql:"nullIf(length(@@AGG1@@(tool_calls)), 0)",aggs:{agg1:"any"},alias:"toolCalls",type:"integer",description:"Number of tool calls per observation.",unit:"calls"}},tableRelations:{traces:{name:"traces",joinConditionSql:"ON observations.trace_id = traces.id AND observations.project_id = traces.project_id",t
1imeDimension:"timestamp"},scores:{name:"scores",joinConditionSql:"ON observations.id = scores.observation_id AND observations.project_id = scores.project_id",timeDimension:"timestamp"}},segments:[],timeDimension:"start_time",baseCte:"observations FINAL"},"scores-numeric":c,"scores-categorical":m},v2:{traces:{name:"events_traces",description:"Traces built from events table aggregation - mirrors v1 traces view with 100% API compatibility.",dimensions:{id:{sql:"events_traces.trace_id",alias:"id",type:"string",description:"Unique identifier of the trace.",highCardinality:!0},name:{sql:"nullIf(events_traces.trace_name, '')",alias:"name",type:"string",description:"Name assigned to the trace (often the endpoint or operation).",aggregationFunction:"argMaxIf(events_traces.trace_name, events_traces.event_ts, events_traces.trace_name <> '')"},tags:{sql:"events_traces.tags",alias:"tags",type:"string[]",description:"User-defined tags associated with the trace.",aggregationFunction:"arrayDistinct(flatten(groupArray(events_traces.tags)))"},userId:{sql:"nullIf(events_traces.user_id, '')",alias:"userId",type:"string",description:"Identifier of the user triggering the trace.",aggregationFunction:"argMaxIf(events_traces.user_id, events_traces.event_ts, events_traces.user_id <> '')",highCardinality:!0},sessionId:{sql:"nullIf(events_traces.session_id, '')",alias:"sessionId",type:"string",description:"Identifier of the session triggering the trace.",aggregationFunction:"argMaxIf(events_traces.session_id, events_traces.event_ts, events_traces.session_id <> '')",highCardinality:!0},release:{sql:"nullIf(events_traces.release, '')",alias:"release",type:"string",description:"Release version of the trace.",aggregationFunction:"argMaxIf(events_traces.release, events_traces.event_ts, events_traces.release <> '')"},version:{sql:"nullIf(events_traces.version, '')",alias:"version",type:"string",description:"Version of the trace.",aggregationFunction:"argMaxIf(events_traces.version, events_traces.event_ts, events_traces.version <> '')"},environment:{sql:"nullIf(events_traces.environment, '')",alias:"environment",type:"string",description:"Deployment environment (e.g., production, staging).",aggregationFunction:"argMaxIf(events_traces.environment, events_traces.event_ts, events_traces.environment <> '')"},timestampMonth:{sql:"events_traces.start_time",alias:"timestampMonth",type:"string",description:"Month of the trace timestamp in YYYY-MM format.",aggregationFunction:"formatDateTime(min(events_traces.start_time), '%Y-%m')"}},measures:{count:{sql:"countIf(events_traces.parent_span_id = '')",alias:"count",type:"integer",description:"Total number of traces.",unit:"traces"},observationsCount:{sql:"uniqIf(events_traces.span_id, events_traces.parent_span_id != '')",alias:"observationsCount",type:"integer",description:"Unique observations linked to the trace.",unit:"observations"},scoresCount:{sql:"uniq(scores.id)",alias:"scoresCount",type:"integer",relationTable:"scores",description:"Unique scores attached to the trace.",unit:"scores"}
1,uniqueUserIds:{sql:"uniq(events_traces.user_id)",alias:"uniqueUserIds",type:"integer",description:"Count of unique userIds.",unit:"users"},uniqueSessionIds:{sql:"uniq(events_traces.session_id)",alias:"uniqueSessionIds",type:"integer",description:"Count of unique sessionIds.",unit:"sessions"},latency:{sql:"date_diff('millisecond', minIf(events_traces.start_time, events_traces.parent_span_id != ''), maxIf(events_traces.end_time, events_traces.parent_span_id != ''))",alias:"latency",type:"integer",description:"Elapsed time between the first and last observation inside the trace.",unit:"millisecond"},totalTokens:{sql:"sumMapIf(events_traces.usage_details, events_traces.parent_span_id != '')['total']",alias:"totalTokens",type:"integer",description:"Sum of tokens consumed by all observations in the trace.",unit:"tokens"},totalCost:{sql:"sumIf(toNullable(events_traces.total_cost), events_traces.parent_span_id != '')",alias:"totalCost",type:"decimal",description:"Total cost accumulated across observations in the trace.",unit:"USD"}},tableRelations:{scores:{name:"scores",joinConditionSql:"ON events_traces.trace_id = scores.trace_id AND events_traces.project_id = scores.project_id",timeDimension:"timestamp"}},segments:[],timeDimension:"start_time",rootEventCondition:{column:"trace_id",condition:"parent_span_id = ''"},baseCte:"events_core events_traces"},observations:{name:"events_observations",description:"Observations represent individual requests or operations within a trace. They are grouped into Spans, Generations, and Events.",dimensions:{id:{sql:"events_observations.span_id",alias:"id",type:"string",description:"Unique identifier for the observation.",highCardinality:!0},traceId:{sql:"events_observations.trace_id",alias:"traceId",type:"string",description:"Identifier linking the observation to its parent trace.",highCardinality:!0},environment:{sql:"nullIf(events_observations.environment, '')",alias:"environment",type:"string",description:"Deployment environment (e.g., production, staging)."},parentObservationId:{sql:"nullIf(events_observations.parent_span_id, '')",alias:"parentObservationId",type:"string",description:"Identifier of the parent observation. Empty for the root span.",highCardinality:!0},type:{sql:"events_observations.type",alias:"type",type:"string",description:"Type of the observation. Can be a SPAN, GENERATION, or EVENT."},name:{sql:"events_observations.name",alias:"name",type:"string",description:"Name of the observation."},level:{sql:"events_observations.level",alias:"level",type:"string",description:"Logging level of the observation."},version:{sql:"nullIf(events_observations.version, '')",alias:"version",type:"string",description:"Version of the observation."},userId:{sql:"nullIf(events_observations.user_id, '')",alias:"userId",type:"string",description:"Identifier of the user triggering the observation.",highCardinality:!0},sessionId:{sql:"nullIf(events_observations.session_id, '')",alias:"sessionId",type:"string",description:"Identifier of the session triggering the observation.",highCardinality:!0},tags:{sql:"events_observations.tags",alias:"tags",type:"string[]",description:"User-defined tags associated with the trace."},release:{sql:"nullIf(events_observations.release, '')",alias:"release",type:"string",description:"Release version."},traceName:{sql:"nullIf(events_observations.trace_name, '')",alias:"traceName",type:"string",description:"Name of the parent trace (backwards-compatible with v1)."},traceRelease:{sql:"nullIf(events_observations.release, '')",alias:"traceRelease",type:"string",description:"Release version of the parent trace (backwards-compatible with v1, maps to denormalized release field)."},traceVersion:{sql:"nullIf(events_observations.version, '')",alias:"traceVersion",type:"string",description:"Version of the parent trace (backwards-compatible with v1, maps to denormalized version field)."},providedModelName:{sql:"nullIf(events_observations.provided_model_name, '')",alias:"providedModelName",type:"string",description:"Name of the model used for the observation."},promptName:{sql:"nullIf(events_observations.prompt_name, '')",alias:"promptName",type:"string",description:"Name of the prompt used for the observation."},promptVersion:{sql:"events_observations.prompt_version",alias:"promptVersion",type:"string",description:"Version of the prompt used for the observation."},startTimeMonth:{sql:"formatDateTime(events_observations.start_time, '%Y-%m')",alias:"startTimeMonth",type:"string",description:"Month of the observation start_time in YYYY-MM format."},toolNames:{sql:"mapKeys(events_observations.tool_definitions)",alias:"toolNames",type:"arrayString",description:"Names of available tools defined for the observation.",explodeArray:!0},calledToolNames:{sql:"events_observations.tool_call_names",alias:"calledToolNames",type:"arrayString",description:"Names of tools that were called by the observation.",explodeArray:!0},costType:{sql:"mapKeys(events_observations.cost_details)",alias:"costType",type:"string",description:"Cost category key from cost_details map (e.g. 'input', 'output', 'total').",pairExpand:{valuesSql:"mapValues(events_observations.cost_details)",valueAlias:"cost_value"}},usageType:{sql:"mapKeys(events_observations.usage_details)",alias:"usageType",type:"string",description:"Token usage category key from usage_details map (e.g. 'input', 'output', 'total').",pairExpand:{valuesSql:"mapValues(events_observations.usage_details)",valueAlias:"usage_value"}}},measures:{count:{sql:"@@AGG@@(1)",aggs:{agg:"count"},alias:"count",type:"integer",description:"Total number of observations.",unit:"observations"},traceId:{sql:"@@AGG@@(events_observations.trace_id)",aggs:{agg:"any"},alias:"traceId",type:"string",description:"Trace identifier; apply uniq aggregation to count distinct traces."},latency:{sql:"date_diff('millisecond', @@AGG1@@(events_observations.start_time), @@AGG1@@(events_observations.end_time))",aggs:{agg1:"any"},alias:"latency",type:"integer",description:"Latency of an individual observation (start time to end time).",unit:"millisecond"},streamingLatency:{sql:"if(isNull(@@AGG1@@(events_observations.completion_start_time)), CAST(NULL AS Nullable(Int64)), date_diff('millisecond', @@AGG1@@(events_observations.completion_start_time), @@AGG1@@(events_observations.end_time)))",aggs:{agg1:"any"},alias:"streamingLatency",type:"integer",description:"Latency of the generation step (completion start time to end time).",unit:"millisecond"},inputTokens:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'input') > 0, @@AGG1@@(usage_details))))",aggs:{agg1:"any"},alias:"inputTokens",type:"integer",description:"Sum of input tokens consumed by the observation.",unit:"tokens"},outputTokens:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(usage_details))))",aggs:{agg1:"any"},alias:"outputTokens",type:"integer",description:"Sum of output tokens produced by the observation.",unit:"tokens"},totalTokens:{sql:"@@AGG1@@(usage_details)['total']",aggs:{agg1:"sumMap"},alias:"totalTokens",type:"integer",description:"Sum of tokens consumed by the observation.",unit:"tokens"},outputTokensPerSecond:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(usage_details)))) / nullIf(date_diff('second', @@AGG1@@(events_observations.completion_start_time), @@AGG1@@(events_observations.end_time)), 0)",aggs:{agg1:"any"},alias:"outputTokensPerSecond",type:"decimal",description:"Average number of output tokens produced per second between completion start time and span end time.",unit:"tokens/s"},tokensPerSecond:{sql:"@@AGG1@@(usage_details)['total'] / nullIf(date_diff('second', @@AGG2@@(events_observations.start_time), @@AGG2@@(events_observations.end_time)), 0)",aggs:{agg1:"sumMap",agg2:"any"},alias:"tokensPerSecond",type:"decimal",description:"Average number of tokens consumed per second by the observation.",unit:"tokens/s"},inputCost:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'input') > 0, @@AGG1@@(cost_details))))",aggs:{agg1:"any"},alias:"inputCost",type:"decimal",description:"Sum of input cost incurred by the observation.",unit:"USD"},outputCost:{sql:"arraySum(mapValues(mapFilter(x -> positionCaseInsensitive(x.1, 'output') > 0, @@AGG1@@(cost_details))))",aggs:{agg1:"any"},alias:"outputCost",type:"decimal",description:"Sum of output cost incurred by the observation.",unit:"USD"},totalCost:{sql:"@@AGG1@@(toNullable(total_cost))",aggs:{agg1:"sum"},alias:"totalCost",type:"decimal",description:"Total cost incurred by the observation.",unit:"USD"},timeToFirstToken:{sql:"if(isNull(@@AGG1@@(events_observations.completion_start_time)), CAST(NULL AS Nullable(Int64)), date_diff('millisecond', @@AGG1@@(events_observations.start_time), @@AGG1@@(events_observations.completion_start_time)))",aggs:{agg1:"any"},alias:"timeToFirstToken",type:"integer",description:"Time to first token for the observation.",unit:"millisecond"},countScores:{sql:"uniq(scores.id)",alias:"countScores",type:"integer",relationTable:"scores",description:"Unique scores attached to the observation.",unit:"scores"},toolDefinitions:{sql:"nullIf(length(mapKeys(@@AGG1@@(events_observations.tool_definitions))), 0)",aggs:{agg1:"any"},alias:"toolDefinitions",type:"integer",description:"Number of available tools per observation.",unit:"tools"},toolCalls:{sql:"nullIf(length(@@AGG1@@(events_observations.tool_calls)), 0)",aggs:{agg1:"any"},alias:"toolCalls",type:"integer",description:"Number of tool calls per observation.",unit:"calls"},costByType:{sql:"cost_value",alias:"costByType",type:"decimal",unit:"USD",requiresDimension:"costType",description:"Sum of cost per category. The costType dimension is auto-included to emit the ARRAY JOIN that brings cost_value into scope."},usageByType:{sql:"usage_value",alias:"usageByType",type:"integer",unit:"tokens",requiresDimension:"usageType",description:"Sum of token usage per category. The usageType dimension is auto-included to emit the ARRAY JOIN that brings usage_value into scope."}},tableRelations:{scores:{name:"scores",joinConditionSql:"ON events_observations.span_id = scores.observation_id AND events_observations.project_id = scores.project_id",t
1imeDimension:"timestamp"}},segments:[],timeDimension:"start_time",baseCte:"events_core events_observations"},"scores-numeric":d,"scores-categorical":l("v2")}}},73526:(e,t,s)=>{function i(e){return"string"==typeof e}s.d(t,{Gh:()=>a,Kg:()=>i});let a=e=>null!=e}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.