Elffuss BraidHub

kikocis/continue public

main · 6.7 KiBSourceRawPermalink

alwaysApply: false

Continue Development Data (Dev Data) Guide

Overview

Development data (dev data) captures detailed information about how developers interact with LLM-aided development tools. Unlike basic telemetry, dev data includes lots of details into the complete software development workflow, including code context, user interactions, and development patterns.

Core Architecture

Primary Implementation Files

Storage Locations

Event Types and Schemas

Core Event Types

  1. tokensGenerated: LLM token usage tracking
  2. autocomplete: Code completion interactions
  3. chatInteraction: Chat-based development assistance
  4. editInteraction: Code editing sessions
  5. editOutcome: Results of edit operations
  6. nextEditOutcome: Next Edit feature outcomes
  7. chatFeedback: User feedback on AI responses
  8. toolUsage: Tool interaction statistics
  9. quickEdit: Quick edit functionality usage

Schema Versioning

Base Schema Structure

All events inherit from a base schema (/packages/config-yaml/src/schemas/data/base.ts):

{
  eventName: string,
  schema: string,
  timestamp: string,
  userId: string,
  userAgent: string,
  selectedProfileId: string
}

Key Integration Points

Autocomplete System

Chat Interface

Edit Features

LLM Token Tracking

Configuration and Customization

Configuration Structure

Dev data is configured through data blocks in your Continue config:

data:
  - name: "Local Development Data"
    destination: "file:///Users/developer/.continue/dev_data"
    schema: "0.2.0"
    level: "all"
    events: ["autocomplete", "chatInteraction", "editOutcome"]

  - name: "Team Analytics"
    destination: "https://analytics.yourcompany.com/api/events"
    schema: "0.2.0"
    level: "noCode"
    apiKey: "your-api-key-here"
    events: ["tokensGenerated", "toolUsage"]

Configuration Options

Privacy Controls

Making Changes to Dev Data

Adding New Event Types

  1. Create schema: Add new event schema in /packages/config-yaml/src/schemas/data/
  2. Update index: Add to schema aggregator in /packages/config-yaml/src/schemas/data/index.ts
  3. Implement logging: Add logging calls in relevant service files
  4. Update version: Consider schema version bump if breaking changes

Modifying Existing Events

  1. Schema changes: Update schema files in /packages/config-yaml/src/schemas/data/
  2. Backward compatibility: Ensure changes don't break existing data consumers
  3. Version management: Increment schema version for breaking changes
  4. Test thoroughly: Validate schema changes with existing data

Adding New Logging Points

  1. Import DataLogger: import { DataLogger } from "core/data/log"
  2. Log events: Call DataLogger.getInstance().logDevData(eventName, data)
  3. Follow patterns: Use existing logging services as examples
  4. Validate data: Ensure logged data matches schema requirements

Debugging Dev Data Issues

  1. Check local storage: Verify files are being created in ~/.continue/dev_data/
  2. Validate schemas: Ensure event data matches expected schema format
  3. Review configuration: Check data blocks in Continue config
  4. Test endpoints: Verify remote endpoints are reachable and accepting data

Best Practices

When Adding New Events

When Modifying Schemas

When Integrating Logging

Common Patterns

Service-Based Logging

Most dev data logging follows a service pattern:

export class FeatureLoggingService {
  private dataLogger = DataLogger.getInstance();

  logFeatureUsage(data: FeatureUsageData) {
    this.dataLogger.logDevData("featureUsage", data);
  }
}

Event-Driven Logging

Events are typically logged at key interaction points:

// When user accepts autocomplete
onAutocompleteAccepted(completion: CompletionData) {
  AutocompleteLoggingService.getInstance().logAutocompleteAccepted(completion);
}

This guide provides the foundation for understanding and working with Continue's dev data system. Always prioritize user privacy and follow established patterns when making changes.