https://github.com/fluent/cprofiles
OpenTelemetry Profiles library implementation for Fluent Bit
https://github.com/fluent/cprofiles
Last synced: 19 days ago
JSON representation
OpenTelemetry Profiles library implementation for Fluent Bit
- Host: GitHub
- URL: https://github.com/fluent/cprofiles
- Owner: fluent
- License: apache-2.0
- Created: 2024-10-31T02:51:45.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-31T18:41:39.000Z (4 months ago)
- Last Synced: 2025-10-31T20:26:34.523Z (4 months ago)
- Language: C
- Size: 961 KB
- Stars: 0
- Watchers: 10
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# CProfiles
The [CProfiles](https://github.com/fluent/cprofiles) provides a simple API to create and manage profiles for monitoring and observability purposes, the internal data structure is based on OpenTelemetry Profiles schema (v1/development):
-
## Build
Clone the repository:
```shell
git clone https://github.com/fluent/cprofiles
```
Get into the project directory and retrieve submodules:
```shell
cd cprofiles/
git submodule update --init --recursive --remote
```
Compile:
```shell
cd build/
cmake -DCPROF_DEV=on ../
make
```
> CPROF_DEV flag enables debugging mode, examples and the unit tests
## Usage
For now you can try out the unit test that compiles when dev mode is enabled: `tests/cprof-test-profile`:
```text
--- profile debug
Profile Duration: 0 nanoseconds
Samples:
Sample #1:
Locations:
[Empty String: No Function Name]
Function: main
Values:
CPU time: 644 ns
Memory usage: 1046 bytes
Timestamps:
Timestamp 0: 1730342869000000000 ns
Sample #2:
Locations:
[Empty String: No Function Name]
Function: foo
Values:
CPU time: 73 ns
Memory usage: 1068 bytes
Timestamps:
Timestamp 0: 1730342869000000000 ns
Sample #3:
Locations:
[Empty String: No Function Name]
Function: bar
Values:
CPU time: 175 ns
Memory usage: 849 bytes
Timestamps:
Timestamp 0: 1730342869000000000 ns
String Table:
0: ''
1: 'CPU time'
2: 'ns'
3: 'Memory usage'
4: 'bytes'
5: 'main'
6: 'foo'
7: 'bar'
```
## License
This program is under the terms of the [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0).
## Authors
Fluent Bit Authors