#### Description 1. Adds `docs/contributing/go/sqlcompiler.md`, a contributing doc for `package sqlcompiler` (the shared list filter DSL to SQL compiler extracted from dashboards in #12806). 2. Covers, in order: the DSL itself (grammar, boolean structure, comparisons, free text), what the framework already handles (parsing, tree walking, operator extraction, predicate builders, error accumulation, arg binding), and what a module must supply (a `FieldResolver`, with the dashboards resolver as the reference implementation). 3. Documents the wiring pattern: a thin module-level `Compile` wrapper mapping compiler errors to the module's error code, keys and allowed operators declared in `pkg/types/<domain>` and advertised as `reservedKeywords`. 4. Adds the doc to the index in `docs/contributing/go/readme.md`. #### Issues closed by this PR Closes SigNoz/pulse-pod#349
Go
This document provides an overview of contributing to the SigNoz backend written in Go. The SigNoz backend is built with Go, focusing on performance, maintainability, and developer experience. We strive for clean, idiomatic code that follows established Go practices while addressing the unique needs of an observability platform.
We adhere to three primary style guides as our foundation:
- Effective Go - For writing idiomatic Go code
- Code Review Comments - For understanding common comments in code reviews
- Google Style Guide - Additional practices from Google
We recommend (almost enforce) reviewing these guides before contributing to the codebase. They provide valuable insights into writing idiomatic Go code and will help you understand our approach to backend development. In addition, we have a few additional rules that make certain areas stricter than the above which can be found in area-specific files in this package:
- Abstractions - When to introduce new types and intermediate representations
- Authz - Authorization, roles, and access control
- ClickHouse SQL - Quoting names and values in generated ClickHouse queries
- Errors - Structured error handling
- Endpoint - HTTP endpoint patterns
- Flagger - Feature flag patterns
- Handler - HTTP handler patterns
- Provider - Dependency injection and provider patterns
- Packages - Naming, layout, and conventions for
pkg/packages - Service - Managed service lifecycle with
factory.Service - SQL - Database and SQL patterns
- DSL Filtering to SQL - Compiling the list filter DSL to relational-store WHERE clauses
- Types - Domain types, request/response bodies, and storage rows in
pkg/types/