[go: up one dir, main page]

Skip to content

Create PoC for local environment emitter with schema validation

Problem

As discussed in issue #557054 (closed), we need to catch instrumentation errors earlier in the development process. Currently, validation issues are only detected after events are sent to Snowplow, making it difficult to attribute errors to the teams that implemented the instrumentation.

Proposed Solution

Create a proof of concept for a second emitter that will:

  1. Run only in local development environments
  2. Call a metric dictionary endpoint that will validate events against their schema
  3. Throw clear errors if events do not conform to the schema

Technical Approach

  1. Another snowplow emitter that intercepts events before they're sent to Snowplow
  2. Create an API endpoint in the metric dictionary service that can:
    • Extract the Iglu schema from the context
    • Validate the payload against the schema
    • Return validation results
  3. Implement error handling that provides clear feedback to developers about schema validation failures
  4. Ensure the solution works across different services (GitLab main app, Frontend, IDE Extensions, AI Gateway)

Benefits

  • Immediate feedback: Developers will see validation errors during local development
  • Consistent validation: Using a centralized endpoint ensures consistent validation logic across services
  • Earlier detection: Catch schema issues before they reach testing or production environments
  • Better developer experience: Clear error messages will help developers fix issues quickly
Edited by 🤖 GitLab Bot 🤖