agent-test.sh uses the build produced by agent-build.sh. The verification
wrapper checks the shell scripts, builds the development configuration, and
runs the complete test suite.
Use the library
Public headers are installed under include/ctraces. Start with
ctraces.h for context lifecycle and follow the
resource, scope, span, attribute, encoder, and decoder headers for focused APIs.
examples/simple-c-api.c demonstrates construction
and cleanup of a complete trace. The other programs under examples/
show OpenTelemetry encoding and decoding.
Install a configured build with:
cmake --install build
Contributing
Repository architecture, ownership rules, compatibility-sensitive areas, and
canonical validation commands are documented in AGENTS.md.
Detailed investigation, bug-fix, review, and cross-repository workflows live in
docs/ai/.
Keep changes focused and add regression coverage for behavior changes. Public
headers and encoded formats are consumed outside this repository, particularly
by Fluent Bit.
CTraces
CTraces is a small C library for creating and managing distributed trace data. It provides an in-memory trace model plus encoders and decoders for:
CTraces is a core library used by Fluent Bit.
Requirements
The repository pins CFL and fluent-otel-proto as Git submodules. MPack is vendored under
lib/mpack.Build
Clone the repository and its pinned dependencies:
For an existing checkout, initialize the dependencies with:
Configure and build the static library and tests out of source:
Available project options:
CTR_DEVOffCTR_TESTSOffCTR_EXAMPLESOffCTR_INSTALL_TARGETSOnTo build the complete development configuration:
The wrapper uses
build/agentby default. SetCTR_BUILD_DIRto use another out-of-source build directory.Test
Run all registered tests:
Or use the repository wrappers:
agent-test.shuses the build produced byagent-build.sh. The verification wrapper checks the shell scripts, builds the development configuration, and runs the complete test suite.Use the library
Public headers are installed under
include/ctraces. Start withctraces.hfor context lifecycle and follow the resource, scope, span, attribute, encoder, and decoder headers for focused APIs.examples/simple-c-api.cdemonstrates construction and cleanup of a complete trace. The other programs underexamples/show OpenTelemetry encoding and decoding.Install a configured build with:
Contributing
Repository architecture, ownership rules, compatibility-sensitive areas, and canonical validation commands are documented in
AGENTS.md. Detailed investigation, bug-fix, review, and cross-repository workflows live indocs/ai/.Keep changes focused and add regression coverage for behavior changes. Public headers and encoded formats are consumed outside this repository, particularly by Fluent Bit.
License
CTraces is licensed under the Apache License 2.0.