Skip to content

Conversation

@koxudaxi
Copy link
Collaborator

@koxudaxi koxudaxi commented Dec 10, 2025

TL;DR

Added database schema for annotations to enable span and trace labeling functionality.

What changed?

Created a new annotations.ts file in the cloud database schema that defines:

  • An annotations table with fields for:
    • Identifiers (id, spanDbId, traceDbId, spanId, traceId)
    • Content (label, reasoning, data)
    • Scope (environmentId, projectId, organizationId)
    • Audit fields (createdBy, createdAt, updatedAt)
  • Unique constraints to ensure one annotation per span+trace+environment
  • Indexes for efficient querying by trace and environment
  • Relation definitions connecting annotations to spans, traces, environments, projects, organizations, and users
  • TypeScript types for internal and public API use

How to test?

  1. Run database migrations to create the new annotations table
  2. Verify the table structure matches the schema definition
  3. Test creating annotations with various combinations of span/trace IDs
  4. Confirm unique constraints prevent duplicate annotations
  5. Test querying annotations using the defined indexes

Why make this change?

This schema enables a new annotations system that allows users to label spans and traces (e.g., as "pass" or "fail") with additional reasoning and structured data. This functionality is essential for:

  1. Quality assessment of traces and spans
  2. Creating training data for ML models
  3. Enabling team collaboration through shared annotations
  4. Supporting audit trails of trace analysis

This was referenced Dec 10, 2025
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch 2 times, most recently from fa6d716 to 5db2b9b Compare January 5, 2026 14:32
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_annotations_schema branch from 5fe05db to 67d2ea7 Compare January 5, 2026 14:32
@willbakst willbakst changed the base branch from 12-10-feat_api_add_functions_api_endpoints to graphite-base/1627 January 6, 2026 00:18
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 67d2ea7 to 97f672e Compare January 6, 2026 00:23
@willbakst willbakst changed the base branch from graphite-base/1627 to 12-10-feat_api_add_functions_api_endpoints January 6, 2026 00:23
@koxudaxi koxudaxi force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from f359a06 to ff17581 Compare January 6, 2026 00:31
@willbakst willbakst force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from ff17581 to 3278d72 Compare January 6, 2026 02:16
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 97f672e to 860c863 Compare January 6, 2026 02:26
@willbakst willbakst force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from 3278d72 to 2436928 Compare January 6, 2026 02:26
@willbakst willbakst force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from 2436928 to 34b23f8 Compare January 6, 2026 02:46
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 860c863 to 418c881 Compare January 6, 2026 02:46
@willbakst willbakst force-pushed the 12-10-feat_api_add_functions_api_endpoints branch from 34b23f8 to 74533de Compare January 6, 2026 02:52
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 418c881 to 367e9f0 Compare January 6, 2026 02:52
@willbakst willbakst force-pushed the 12-10-feat_api_add_functions_api_endpoints branch 3 times, most recently from 053104a to 51fbdc1 Compare January 6, 2026 02:58
@willbakst willbakst changed the base branch from 12-10-feat_api_add_functions_api_endpoints to graphite-base/1627 January 6, 2026 03:02
@willbakst willbakst changed the base branch from graphite-base/1627 to v2 January 6, 2026 03:04
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 367e9f0 to 77bf011 Compare January 6, 2026 03:06
@graphite-app
Copy link

graphite-app bot commented Jan 6, 2026

Merge activity

  • Jan 6, 3:06 AM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Jan 6, 3:17 AM UTC: @willbakst merged this pull request with Graphite.

@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 77bf011 to 881a049 Compare January 6, 2026 03:12
@willbakst willbakst force-pushed the 12-10-feat_db_add_annotations_schema branch from 881a049 to 2e06f00 Compare January 6, 2026 03:15
@willbakst willbakst merged commit 97399ea into v2 Jan 6, 2026
11 checks passed
@willbakst willbakst deleted the 12-10-feat_db_add_annotations_schema branch January 6, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants