diff options
Diffstat (limited to 'fluent-bit/examples/tracing')
-rw-r--r-- | fluent-bit/examples/tracing/docker-compose.yml | 26 | ||||
-rwxr-xr-x | fluent-bit/examples/tracing/enable-tracing.sh | 21 | ||||
-rw-r--r-- | fluent-bit/examples/tracing/fluent-bit.conf | 14 |
3 files changed, 61 insertions, 0 deletions
diff --git a/fluent-bit/examples/tracing/docker-compose.yml b/fluent-bit/examples/tracing/docker-compose.yml new file mode 100644 index 00000000..94d00634 --- /dev/null +++ b/fluent-bit/examples/tracing/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3" + +services: + fluent-bit: + build: + context: ../.. + dockerfile: dockerfiles/Dockerfile + args: + - FLB_CHUNK_TRACE=On + ports: + - "2020:2020" + volumes: + - ./fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:ro + command: + - /fluent-bit/bin/fluent-bit + - -Z + - -c + - /fluent-bit/etc/fluent-bit.conf + + enable-tracing: + image: ubuntu:20.04 + command: /enable-tracing.sh + volumes: + - ./enable-tracing.sh:/enable-tracing.sh:ro + environment: + REMOTE_HOST: fluent-bit diff --git a/fluent-bit/examples/tracing/enable-tracing.sh b/fluent-bit/examples/tracing/enable-tracing.sh new file mode 100755 index 00000000..5bff2b90 --- /dev/null +++ b/fluent-bit/examples/tracing/enable-tracing.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -eu + +REMOTE_HOST=${REMOTE_HOST:-127.0.0.1} + +if command -v http &> /dev/null ; then + http -v "$REMOTE_HOST":2020/api/v1/trace/dummy.0 output=stdout prefix=trace. params:='{"format":"json"}' +elif command -v curl &> /dev/null ; then + curl --header 'Content-Type: application/json' --data '{"output": "stdout", "params": { "format": "json" }, "prefix": "trace."}' "$REMOTE_HOST":2020/api/v1/trace/dummy.0 +else + echo "No curl or httpie installed" + if command -v apt-get &> /dev/null ; then + apt-get -qq update + apt-get -qq install -y curl + elif command -v yum &> /dev/null ; then + yum install -y curl + else + exit 1 + fi + curl --header 'Content-Type: application/json' --data '{"output": "stdout", "params": { "format": "json" }, "prefix": "trace."}' "$REMOTE_HOST":2020/api/v1/trace/dummy.0 +fi diff --git a/fluent-bit/examples/tracing/fluent-bit.conf b/fluent-bit/examples/tracing/fluent-bit.conf new file mode 100644 index 00000000..0d83db70 --- /dev/null +++ b/fluent-bit/examples/tracing/fluent-bit.conf @@ -0,0 +1,14 @@ +[SERVICE] + Http_Server On + +[INPUT] + Name dummy + +[FILTER] + Name record_modifier + Match * + Record foo bar + +[OUTPUT] + Name stdout + Match * |