|
| 1 | +# Bootstrap Zig Special Interest Group |
| 2 | + |
| 3 | +## Background and description |
| 4 | + |
| 5 | +Zig is a general-purpose programming language designed for performance, robustness, and clarity. |
| 6 | +One of Zig's key features is its seamless interoperability with C, making it a compelling choice for systems programming. |
| 7 | +Zig code can compile to C and eBPF natively, and it speaks the C ABI without the need for bindings or FFI layers. |
| 8 | +Zig is already used in OpenTelemetry in the [opentelemetry-injector](https://github.com/open-telemetry/opentelemetry-injector) project. |
| 9 | + |
| 10 | +This project is the continuation of what proposed in #2514. |
| 11 | +Over the past year, a handful of people have dedicated time to develop a working SDK and this proposal aims at making Zig an officially supported language in OpenTelemetry. |
| 12 | +By doing so, we would enable two distinct developer communities: |
| 13 | + |
| 14 | +1. **Zig developers**: A growing community building systems software, web services, games and low-latency applications |
| 15 | +2. **C developers**: Who can leverage the Zig OpenTelemetry implementation directly through C ABI compatibility |
| 16 | + |
| 17 | +The aforementioned work-in-progress SDK implementations exist at [zig-o11y/opentelemetry-sdk](https://github.com/zig-o11y/opentelemetry-sdk), demonstrating community interest and initial technical feasibility. |
| 18 | +A complementary Semantic Convention library is developed at [zig-o11y/opentelemetry-semconv](https://github.com/zig-o11y/opentelemetry-semconv). |
| 19 | +However, these efforts are fragmented and lack official OpenTelemetry support, governance, and long-term maintenance commitments. |
| 20 | + |
| 21 | +### Current challenges |
| 22 | + |
| 23 | +**Lack of Official OpenTelemetry Support for Zig and C:** |
| 24 | +- Zig developers currently have no official OpenTelemetry SDK, forcing them to use wrappers around the C++ implementation, use foreign language bindings or forgo observability altogether |
| 25 | +- C developers lack a modern, actively maintained OpenTelemetry implementation that follows current specification versions |
| 26 | +- Existing unofficial implementations are fragmented and not coordinated under OpenTelemetry governance |
| 27 | + |
| 28 | +**Fragmented Community Efforts:** |
| 29 | +Multiple independent implementations lead to duplicated effort and inconsistent quality. |
| 30 | +Without official SIG coordination, these efforts may diverge from OpenTelemetry specifications and there is no clear path for Zig/C developers to contribute to or adopt OpenTelemetry. |
| 31 | + |
| 32 | +### Goals, objectives, and requirements |
| 33 | + |
| 34 | +The primary goal of this project is to bootstrap a Zig SIG that will create and maintain an official OpenTelemetry implementation for the Zig programming language, with initial deliverables focused on establishing a compliant, production-ready SDK. |
| 35 | + |
| 36 | +**Specific Objectives** |
| 37 | + |
| 38 | +1. **Create OpenTelemetry API for Zig** covering stable signals: baggage, traces, metrics, and logs |
| 39 | +2. **Implement OpenTelemetry SDK** providing the official implementation for signal collection, processing, and export |
| 40 | +3. **Provide continued support to Semantic Conventions library** enabling consistent instrumentation across Zig applications |
| 41 | +4. **Establish C ABI compatibility layer** allowing C developers to use the Zig implementation seamlessly |
| 42 | +5. **Create comprehensive documentation** including API references, usage guides, and examples for both Zig and C developers |
| 43 | +6. **Build test infrastructure** ensuring specification compliance and compatibility across Zig versions |
| 44 | + |
| 45 | +**Requirements** |
| 46 | + |
| 47 | +- Compliance with OpenTelemetry specification v1.48 (precise version is TBD based on timeline) |
| 48 | +- Support for current stable Zig version (0.15.2 at time of writing) with commitment to track language releases |
| 49 | +- Cross-platform support (Linux, macOS, Windows) |
| 50 | +- Zero-dependency core implementation where possible, with minimal dependencies for exporters |
| 51 | +- C ABI compatibility verified through examples and tests |
| 52 | +- Documentation with code examples |
| 53 | + |
| 54 | +_Note_: some of the above are already implemented in the un-official SDK. |
| 55 | + |
| 56 | +**Motivation for Starting Now** |
| 57 | + |
| 58 | +- Zig adoption is growing, particularly in systems programming and infrastructure domains where observability is critical |
| 59 | +- Possibility to onboard C developers with an OpenTelemetry solution |
| 60 | + |
| 61 | +**Benefits to OpenTelemetry** |
| 62 | + |
| 63 | +- Extends OpenTelemetry reach to Zig and C developer communities |
| 64 | +- Demonstrates OpenTelemetry's versatility across diverse programming language paradigms |
| 65 | +- Creates potential for novel integration patterns through Zig's C/eBPF compilation capabilities |
| 66 | +- Establishes a foundation for future work in eBPF-based auto-instrumentation using Zig |
| 67 | + |
| 68 | +## Deliverables |
| 69 | + |
| 70 | +This project will deliver the following components, organized by priority: |
| 71 | + |
| 72 | +**1. Formation of a SIG** |
| 73 | +- Scout for additional community member interested in supporting the language |
| 74 | +- Create documents and recurring meetings |
| 75 | + |
| 76 | +**2. OpenTelemetry API for Zig** |
| 77 | +- Trace API implementing the specification |
| 78 | +- Logs API implementing the specification |
| 79 | +- Metrics API implementing the specification |
| 80 | +- Context propagation and baggage APIs |
| 81 | +- C header exports for all APIs |
| 82 | + |
| 83 | +**3. Core SDK Implementation** |
| 84 | +- Tracer Provider and Span Processor implementations |
| 85 | +- Meter Provider and aggregation implementations |
| 86 | +- Logger Provider implementation |
| 87 | +- Resource detection and configuration |
| 88 | +- OTLP exporter (HTTP and gRPC) |
| 89 | + |
| 90 | +## Expected responsibilities |
| 91 | + |
| 92 | +Once formed, the future work of the SIG will be to adhere to the practice existing for other supported language, including: |
| 93 | + |
| 94 | +- build and distribution infrastructure |
| 95 | +- stabilize the Semantic Conventions library |
| 96 | +- develop exporters supported in other languages |
| 97 | +- publish API documentation (generated from code) |
| 98 | +- produce user guide covering installation, basic usage, and configuration |
| 99 | +- provide example applications for Zig (HTTP server, CLI tool) |
| 100 | +- provide example C applications demonstrating C ABI usage |
| 101 | +- performance benchmarks |
| 102 | +- security audit of implementation |
| 103 | +- create a production deployment guide |
| 104 | +- maintain versioning and compatibility policy |
| 105 | +- create the first stable release (v1.0.0) |
| 106 | + |
| 107 | +## Staffing / Help Wanted |
| 108 | + |
| 109 | +### Industry outreach |
| 110 | + |
| 111 | +The following communities and companies should be made aware of this effort: |
| 112 | + |
| 113 | +**Communities:** |
| 114 | +- Zig Software Foundation and core Zig community |
| 115 | +- Systems programming communities using C who could benefit from OpenTelemetry observability |
| 116 | +- eBPF Foundation members working on observability tooling |
| 117 | +- OpenTelemetry language SIG maintainers for cross-SIG collaboration |
| 118 | + |
| 119 | +**Companies Known to Use Zig:** |
| 120 | +- Tigerbeetle (distributed financial transactions database) |
| 121 | +- Bun (JavaScript runtime, acquired by Anthropic) |
| 122 | +- ZML (Machine Learning platform) |
| 123 | +- LightPanda (AI agent browser) |
| 124 | +- Various infrastructure and systems programming companies in the Zig community |
| 125 | + |
| 126 | +Outreach will be conducted through: |
| 127 | +- Announcement in Zig Discord and community forums |
| 128 | +- Blog post on OpenTelemetry website upon project approval |
| 129 | +- Presentation at CNCF TAG Observability or related events |
| 130 | +- Engagement with companies in the Zig ecosystem through direct contact |
| 131 | + |
| 132 | +### SIG |
| 133 | + |
| 134 | +#### Project Lead(s) |
| 135 | + |
| 136 | +The following individuals have expressed interest and commitment to leading this project: |
| 137 | + |
| 138 | +- **@inge4pres** (Francesco, Elastic) - Maintainer |
| 139 | +- **@kmos** (Giovanni, Red Hat) - Maintainer |
| 140 | +- **@hendriknielaender** (Hendrik, independent) - Maintainer |
| 141 | +- **@kakkoyun** (Kemal, DataDog) - Approver |
| 142 | +- **@jaronoff97** (Jacob, Tero) - Approver |
| 143 | + |
| 144 | +These individuals will become SIG maintainers upon project approval. |
| 145 | + |
| 146 | +#### Contributors |
| 147 | + |
| 148 | +We haven't had continued external contributions that haven't turned into maintainer roles. |
| 149 | +We hope that by making Zig support official, more contributors will step in. |
| 150 | + |
| 151 | +**Additional Contributors Sought:** |
| 152 | +- Engineers with Zig experience willing to contribute to SDK implementation |
| 153 | +- C developers who can test and validate C ABI compatibility |
| 154 | +- Documentation writers for user guides and examples |
| 155 | +- Developers with eBPF experience for future auto-instrumentation work |
| 156 | + |
| 157 | +**Cross-SIG Review (for future OTEPs if needed):** |
| 158 | +- If specification changes are proposed, maintainers from at least two other language SIGs will be recruited for prototype review |
| 159 | +- Initial implementation will follow existing specifications, minimizing this requirement |
| 160 | + |
| 161 | +### Sponsorship |
| 162 | + |
| 163 | +#### TC Sponsor |
| 164 | + |
| 165 | +Joshua MacDonald ([@jmacd](https://github.com/jmacd)) |
| 166 | + |
| 167 | +#### GC Liaison |
| 168 | + |
| 169 | +Alolita Sharma ([@alolita](https://github.com/alolita)) |
| 170 | + |
| 171 | +### Zig Version Compatibility Strategy |
| 172 | + |
| 173 | +Given that Zig is pre-1.0 and breaking changes occur between releases, the SIG will: |
| 174 | +- Target the latest stable Zig release at time of development |
| 175 | +- Commit to updating for new Zig releases within 4 weeks of release |
| 176 | +- Maintain compatibility with at minimum the current and previous Zig version |
| 177 | +- Document Zig version compatibility clearly in README and releases |
| 178 | +- Use CI to test against multiple Zig versions |
| 179 | +- After Zig 1.0 is released, adopt a more stable compatibility policy |
| 180 | + |
| 181 | +This maintenance burden is acknowledged and accepted by the project leads as part of the commitment to this SIG. |
| 182 | + |
| 183 | +## References |
| 184 | + |
| 185 | +- Issue #2514: [Zig SIG: current level of interest?](https://github.com/open-telemetry/community/issues/2514) |
| 186 | +- Zig Programming Language: https://ziglang.org |
| 187 | +- Existing implementations: |
| 188 | + - https://github.com/zig-o11y/opentelemetry-sdk |
| 189 | + - https://github.com/zig-o11y/opentelemetry-semconv |
| 190 | + - https://github.com/zig-o11y/opentelemetry-proto |
| 191 | + |
| 192 | +## License and copyright |
| 193 | + |
| 194 | +The existing implementations mentioned above have a MIT license and the copyright holders are willing to donate them to CNCF. |
0 commit comments