https://github.com/fast/libfastrace
C binding for fastrace: A tracing library 10~100x faster than others
https://github.com/fast/libfastrace
Last synced: about 1 year ago
JSON representation
C binding for fastrace: A tracing library 10~100x faster than others
- Host: GitHub
- URL: https://github.com/fast/libfastrace
- Owner: fast
- License: apache-2.0
- Created: 2024-09-03T07:07:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T03:16:55.000Z (over 1 year ago)
- Last Synced: 2025-04-05T18:50:32.663Z (about 1 year ago)
- Language: C++
- Homepage:
- Size: 98.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fastrace for C/C++
fastrace for C/C++.
It's built on top of
[fastrace in Rust](https://github.com/fast/fastrace) via [cxx](https://github.com/dtolnay/cxx).
## Requirements
- C++11 or later
- Rust environment
## Prepare
```bash
# install rust environment
curl https://sh.rustup.rs -sSf | sh
```
## Build
```bash
## compile in build directory
cmake -S . -B build && cmake --build build
## install to /usr/local
sudo cmake --install build
```
## Uninstall
To uninstall the library, use the following command:
```bash
sudo cmake --build build --target uninstall
```
## Run example
```bash
# start an OTEL Exporter, eg Jaeger
docker run -d --name jaeger -e COLLECTOR_OTLP_ENABLED=true -e SPAN_STORAGE_TYPE=badger -e BADGER_EPHEMERAL=false -e BADGER_DIRECTORY_VALUE=/badger/data -e BADGER_DIRECTORY_KEY=/badger/key -v /mnt/badger:/badger -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:1.46
cd examples && cmake -S . -B build && cmake --build build
# run example
SERVICE_NAME=asynchronous ./build/asynchronous # c api
SERVICE_NAME=asynchronous2 ./build/asynchronous2 # c++ api
```