summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/ctraces/examples/otlp-decoder.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:44 +0000
commit836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch)
tree1604da8f482d02effa033c94a84be42bc0c848c3 /fluent-bit/lib/ctraces/examples/otlp-decoder.c
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz
netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/ctraces/examples/otlp-decoder.c')
-rw-r--r--fluent-bit/lib/ctraces/examples/otlp-decoder.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/fluent-bit/lib/ctraces/examples/otlp-decoder.c b/fluent-bit/lib/ctraces/examples/otlp-decoder.c
deleted file mode 100644
index 2b3d390da..000000000
--- a/fluent-bit/lib/ctraces/examples/otlp-decoder.c
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <ctraces/ctraces.h>
-#include <fluent-otel-proto/fluent-otel.h>
-
-int main()
-{
- FILE *fp;
- struct ctrace *ctr;
-
- char *text;
- char *buf;
- int result;
- int bufsize;
- size_t offset;
- size_t newLen;
-
- offset = 0;
- bufsize = 0;
- buf = NULL;
-
- fp = fopen("examples/sample_trace.bin", "rb");
-
- if (fp != NULL) {
- if (fseek(fp, 0L, SEEK_END) == 0) {
-
- bufsize = ftell(fp);
- if (bufsize == -1)
- {
- printf("error in reading file size");
- }
-
- buf = malloc(sizeof(char) * (bufsize + 1));
-
- if (fseek(fp, 0L, SEEK_SET) != 0) {
- printf("seek error");
- }
-
- newLen = fread(buf, sizeof(char), bufsize, fp);
- if (ferror(fp) != 0) {
- fputs("Error reading file", stderr);
- }
- else {
- buf[newLen++] = '\0';
- }
- }
- fclose(fp);
- }
-
- result = ctr_decode_opentelemetry_create(&ctr, buf, bufsize, &offset);
- if (result == -1) {
- printf("Unable to decode trace sample");
- }
-
- text = ctr_encode_text_create(ctr);
- printf("%s\n", text);
- ctr_encode_text_destroy(text);
-
- ctr_destroy(ctr);
- free(buf);
-
- return 0;
-} \ No newline at end of file