@mastra/clickhouse 1.21.1 → 1.22.0-alpha.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/dist/index.js CHANGED
@@ -6567,6 +6567,22 @@ const TRACE_FIELDS = {
6567
6567
  sql: "r.resourceId",
6568
6568
  parameterType: "String"
6569
6569
  },
6570
+ runId: {
6571
+ sql: "r.runId",
6572
+ parameterType: "String"
6573
+ },
6574
+ sessionId: {
6575
+ sql: "r.sessionId",
6576
+ parameterType: "String"
6577
+ },
6578
+ userId: {
6579
+ sql: "r.userId",
6580
+ parameterType: "String"
6581
+ },
6582
+ organizationId: {
6583
+ sql: "r.organizationId",
6584
+ parameterType: "String"
6585
+ },
6570
6586
  startedAt: {
6571
6587
  sql: "r.startedAt",
6572
6588
  parameterType: "DateTime64(3, 'UTC')"
@@ -6660,6 +6676,22 @@ const SPAN_FIELDS = {
6660
6676
  rootEntityVersionId: {
6661
6677
  sql: "s.rootEntityVersionId",
6662
6678
  parameterType: "String"
6679
+ },
6680
+ runId: {
6681
+ sql: "s.runId",
6682
+ parameterType: "String"
6683
+ },
6684
+ sessionId: {
6685
+ sql: "s.sessionId",
6686
+ parameterType: "String"
6687
+ },
6688
+ userId: {
6689
+ sql: "s.userId",
6690
+ parameterType: "String"
6691
+ },
6692
+ organizationId: {
6693
+ sql: "s.organizationId",
6694
+ parameterType: "String"
6663
6695
  }
6664
6696
  };
6665
6697
  const SCORE_FIELDS = {
@@ -6883,6 +6915,12 @@ function compileClickHouseTraceScope(selection, relationCollections, parameters,
6883
6915
  SELECT * FROM (
6884
6916
  SELECT *
6885
6917
  FROM ${TABLE_TRACE_ROOTS}
6918
+ WHERE traceId IN (
6919
+ SELECT traceId
6920
+ FROM ${TABLE_TRACE_ROOTS}
6921
+ WHERE startedAt >= ${from}
6922
+ AND startedAt < ${to}${tenant}
6923
+ )
6886
6924
  ORDER BY dedupeKey
6887
6925
  LIMIT 1 BY dedupeKey
6888
6926
  )
@@ -6911,7 +6949,11 @@ function compileClickHouseTraceScope(selection, relationCollections, parameters,
6911
6949
  entityName,
6912
6950
  entityVersionId,
6913
6951
  parentEntityVersionId,
6914
- rootEntityVersionId
6952
+ rootEntityVersionId,
6953
+ runId,
6954
+ sessionId,
6955
+ userId,
6956
+ organizationId
6915
6957
  FROM ${TABLE_SPAN_EVENTS}
6916
6958
  WHERE isNotNull(traceId)
6917
6959
  AND traceId IN (SELECT traceId FROM root_scope)${tenant}
@@ -8621,7 +8663,8 @@ var ObservabilityStorageClickhouseVNext = class extends ObservabilityStorage {
8621
8663
  "trace-query-discovery",
8622
8664
  "thread-query",
8623
8665
  "trace-query-tenant-scope",
8624
- "feedback"
8666
+ "feedback",
8667
+ "trace-query-context-ids"
8625
8668
  ];
8626
8669
  return [
8627
8670
  "metrics",
@@ -8638,7 +8681,8 @@ var ObservabilityStorageClickhouseVNext = class extends ObservabilityStorage {
8638
8681
  "trace-query-discovery",
8639
8682
  "thread-query",
8640
8683
  "trace-query-tenant-scope",
8641
- "feedback"
8684
+ "feedback",
8685
+ "trace-query-context-ids"
8642
8686
  ];
8643
8687
  }
8644
8688
  async createSpan(args) {