Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: add operation_name tag to AMT query experiments (#8294)

Steffen Schmitz312066f73552
diff --git a/packages/shared/src/server/repositories/observations.ts b/packages/shared/src/server/repositories/observations.ts
index 13d9b36d67..da093ddea4 100644
--- a/packages/shared/src/server/repositories/observations.ts
+++ b/packages/shared/src/server/repositories/observations.ts
@@ -783,6 +783,7 @@ const getObservationsTableInternal = async <T>(
type: "observation",
projectId,
kind: opts.select,
+ operation_name: "getObservationsTableInternal",
},
},
existingExecution: async (input) => {
diff --git a/packages/shared/src/server/repositories/scores.ts b/packages/shared/src/server/repositories/scores.ts
index bcd0347f2b..8ca8476bc4 100644
--- a/packages/shared/src/server/repositories/scores.ts
+++ b/packages/shared/src/server/repositories/scores.ts
@@ -966,6 +966,7 @@ const getScoresUiGeneric = async <T>(props: {
type: "score",
projectId,
select: props.select,
+ operation_name: "getScoresUiGeneric",
},
},
existingExecution: async (input) => {
diff --git a/packages/shared/src/server/repositories/traces.ts b/packages/shared/src/server/repositories/traces.ts
index 1e590486c3..dde0500d1a 100644
--- a/packages/shared/src/server/repositories/traces.ts
+++ b/packages/shared/src/server/repositories/traces.ts
@@ -166,6 +166,7 @@ export const checkTraceExists = async ({
type: "trace",
kind: "exists",
projectId,
+ operation_name: "checkTraceExists",
},
timestamp: timestamp ?? exactTimestamp,
},
@@ -295,6 +296,7 @@ export const getTracesByIds = async (
type: "trace",
kind: "byId",
projectId,
+ operation_name: "getTracesByIds",
},
clickhouseConfigs,
},
@@ -376,6 +378,7 @@ export const getTracesBySessionId = async (
type: "trace",
kind: "list",
projectId,
+ operation_name: "getTracesBySessionId",
},
timestamp,
},
@@ -451,6 +454,7 @@ export const hasAnyTrace = async (projectId: string) => {
type: "trace",
kind: "hasAny",
projectId,
+ operation_name: "hasAnyTrace",
},
},
existingExecution: async (input) => {
@@ -511,6 +515,7 @@ export const getTraceCountsByProjectInCreationInterval = async ({
feature: "tracing",
type: "trace",
kind: "analytic",
+ operation_name: "getTraceCountsByProjectInCreationInterval",
},
timestamp: start,
},
@@ -585,6 +590,7 @@ export const getTraceCountOfProjectsSinceCreationDate = async ({
feature: "tracing",
type: "trace",
kind: "analytic",
+ operation_name: "getTraceCountOfProjectsSinceCreationDate",
},
timestamp: start,
},
@@ -663,6 +669,7 @@ export const getTraceById = async ({
type: "trace",
kind: "byId",
projectId,
+ operation_name: "getTraceById",
},
},
existingExecution: (input) => {
@@ -760,6 +767,7 @@ export const getTracesGroupedByName = async (
type: "trace",
kind: "analytic",
projectId,
+ operation_name: "getTracesGroupedByName",
},
},
existingExecution: async (input) => {
@@ -857,6 +865,7 @@ export const getTracesGroupedByUsers = async (
type: "trace",
kind: "analytic",
projectId,
+ operation_name: "getTracesGroupedByUsers",
},
},
existingExecution: async (input) => {
@@ -950,6 +959,7 @@ export const getTracesGroupedByTags = async (props: GroupedTracesQueryProp) => {
type: "trace",
kind: "analytic",
projectId,
+ operation_name: "getTracesGroupedByTags",
},
},
existingExecution: async (input) => {
@@ -1013,6 +1023,7 @@ export const getTracesIdentifierForSession = async (
type: "trace",
kind: "list",
projectId,
+ operation_name: "getTracesIdentifierForSession",
},
},
existingExecution: (input) => {
@@ -1166,6 +1177,7 @@ export const hasAnyUser = async (projectId: string) => {
type: "user",
kind: "hasAny",
projectId,
+ operation_name: "hasAnyUser",
},
},
existingExecution: async (input) => {
@@ -1240,6 +1252,7 @@ export const getTotalUserCount = async (
type: "trace",
kind: "analytic",
projectId,
+ operation_name: "getTotalUserCount",
},
},
existingExecution: async (input) => {
@@ -1396,6 +1409,7 @@ export const getUserMetrics = async (
type: "trace",
kind: "analytic",
projectId,
+ operation_name: "getUserMetrics",
},
},
existingExecution: async (input) => {
@@ -1621,6 +1635,7 @@ export const getTracesByIdsForAnyProject = async (traceIds: string[]) => {
feature: "tracing",
type: "trace",
kind: "list",
+ operation_name: "getTracesByIdsForAnyProject",
},
},
existingExecution: async (input) => {
diff --git a/packages/shared/src/server/services/sessions-ui-table-service.ts b/packages/shared/src/server/services/sessions-ui-table-service.ts
index 42caede325..2669dc9dea 100644
--- a/packages/shared/src/server/services/sessions-ui-table-service.ts
+++ b/packages/shared/src/server/services/sessions-ui-table-service.ts
@@ -399,6 +399,7 @@ const getSessionsTableGeneric = async <T>(props: FetchSessionsTableProps) => {
feature: "tracing",
type: "sessions-table",
projectId,
+ operation_name: "getSessionsTableGeneric",
},
},
existingExecution: async (input) => {
diff --git a/packages/shared/src/server/services/traces-ui-table-service.ts b/packages/shared/src/server/services/traces-ui-table-service.ts
index b52439f4ee..494601768c 100644
--- a/packages/shared/src/server/services/traces-ui-table-service.ts
+++ b/packages/shared/src/server/services/traces-ui-table-service.ts
@@ -480,6 +480,7 @@ async function getTracesTableGeneric(props: FetchTracesTableProps) {
type: "traces-table",
projectId,
experiment_amt: "original",
+ operation_name: "getTracesTableGeneric",
},
clickhouseConfigs,
});
@@ -590,6 +591,7 @@ async function getTracesTableGeneric(props: FetchTracesTableProps) {
type: "traces-table",
projectId,
experiment_amt: "new",
+ operation_name: "getTracesTableGeneric",
},
clickhouseConfigs,
});
diff --git a/web/src/features/public-api/server/observations.ts b/web/src/features/public-api/server/observations.ts
index 88889f6a50..5e6f290f9d 100644
--- a/web/src/features/public-api/server/observations.ts
+++ b/web/src/features/public-api/server/observations.ts
@@ -94,6 +94,7 @@ export const generateObservationsForPublicApi = async (props: QueryType) => {
feature: "tracing",
type: "observation",
projectId: props.projectId,
+ operation_name: "generateObservationsForPublicApi",
},
},
existingExecution: async (input) => {
@@ -138,6 +139,7 @@ export const getObservationsCountForPublicApi = async (props: QueryType) => {
feature: "tracing",
type: "observation",
projectId: props.projectId,
+ operation_name: "getObservationsCountForPublicApi",
},
},
existingExecution: async (input) => {
diff --git a/web/src/features/public-api/server/scores.ts b/web/src/features/public-api/server/scores.ts
index e7f04c751b..3ffb6d3357 100644
--- a/web/src/features/public-api/server/scores.ts
+++ b/web/src/features/public-api/server/scores.ts
@@ -120,6 +120,7 @@ export const _handleGenerateScoresForPublicApi = async ({
type: "score",
projectId: props.projectId,
scoreScope,
+ operation_name: "_handleGenerateScoresForPublicApi",
},
},
existingExecution: async (input) => {
@@ -237,6 +238,7 @@ export const _handleGetScoresCountForPublicApi = async ({
type: "score",
projectId: props.projectId,
scoreScope,
+ operation_name: "_handleGetScoresCountForPublicApi",
},
},
existingExecution: async (input) => {
diff --git a/web/src/features/public-api/server/traces.ts b/web/src/features/public-api/server/traces.ts
index a9c6ee32a7..2b59076ad4 100644
--- a/web/src/features/public-api/server/traces.ts
+++ b/web/src/features/public-api/server/traces.ts
@@ -136,6 +136,7 @@ export const generateTracesForPublicApi = async ({
type: "trace",
kind: "public-api",
projectId: props.projectId,
+ operation_name: "getTracesForPublicApi",
},
fromTimestamp: timeFilter?.value ?? undefined,
},