Skip to content

Conversation

@koxudaxi
Copy link
Collaborator

@koxudaxi koxudaxi commented Dec 10, 2025

TL;DR

Added database schema for annotations and functions to support span annotations and function registry features.

What changed?

  • Created a new migration file (0007_dark_wendigo.sql) that adds two new tables:

    • annotations: Stores user-created annotations for spans with fields for labels, reasoning, and associated metadata
    • functions: Stores function definitions with versioning support, including code, signature, dependencies, and metadata
  • Added TypeScript schema definition for the functions table with:

    • Version identification (hash, signature hash)
    • Metadata fields (name, description, version, tags)
    • Code storage (complete code, signature, dependencies)
    • Proper relations to environments, projects, and organizations
    • Indexes for efficient querying
  • Added appropriate foreign key constraints and indexes for both tables

How to test?

  1. Run the migration to create the new tables
  2. Verify the tables are created with the correct schema
  3. Test the foreign key constraints by attempting to delete referenced records
  4. Verify the uniqueness constraints work as expected (e.g., try to create duplicate function entries with the same hash in the same environment)

Why make this change?

This change enables two key features:

  1. Span annotations: Allows users to add custom labels and reasoning to spans for better trace analysis and collaboration
  2. Function registry: Provides a way to store, version, and retrieve function definitions, supporting code reuse and standardization across environments

Both features enhance the observability platform by adding context to traces and supporting function management capabilities.

This was referenced Dec 10, 2025
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch 4 times, most recently from 6afaafa to 0da1a5d Compare January 5, 2026 09:18
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 0da1a5d to 6af4a16 Compare January 5, 2026 09:48
@koxudaxi koxudaxi requested a review from willbakst January 5, 2026 09:52
@koxudaxi koxudaxi force-pushed the 12-09-chore_api_regenerate_python_sdk_for_traces_endpoint branch from 0fd64bb to b0d937e Compare January 5, 2026 14:14
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 6af4a16 to eca6691 Compare January 5, 2026 14:15
@koxudaxi koxudaxi force-pushed the 12-09-chore_api_regenerate_python_sdk_for_traces_endpoint branch from b0d937e to df92737 Compare January 5, 2026 14:32
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from eca6691 to be37dd1 Compare January 5, 2026 14:32
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from be37dd1 to 154a7a8 Compare January 6, 2026 00:04
@willbakst willbakst force-pushed the 12-09-chore_api_regenerate_python_sdk_for_traces_endpoint branch from df92737 to 6a7ed64 Compare January 6, 2026 00:04
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 154a7a8 to b142be9 Compare January 6, 2026 00:23
@koxudaxi koxudaxi force-pushed the 12-09-chore_api_regenerate_python_sdk_for_traces_endpoint branch from 6a7ed64 to c70bc7e Compare January 6, 2026 00:29
@koxudaxi koxudaxi force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from b142be9 to 379c74a Compare January 6, 2026 00:29
@willbakst willbakst changed the base branch from 12-09-chore_api_regenerate_python_sdk_for_traces_endpoint to graphite-base/1623 January 6, 2026 02:10
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 379c74a to 48b4b12 Compare January 6, 2026 02:15
@graphite-app graphite-app bot changed the base branch from graphite-base/1623 to v2 January 6, 2026 02:16
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 48b4b12 to 5f15f42 Compare January 6, 2026 02:16
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 5f15f42 to 965b130 Compare January 6, 2026 02:26
@willbakst willbakst force-pushed the 12-10-feat_db_add_functions_schema_and_migration branch from 965b130 to fce5987 Compare January 6, 2026 02:46
@willbakst willbakst merged commit 0257fad into v2 Jan 6, 2026
12 checks passed
Copy link
Collaborator

Merge activity

@willbakst willbakst deleted the 12-10-feat_db_add_functions_schema_and_migration branch January 6, 2026 02:50
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