Open Telemetry
Overview
FeatBit's backend services, including the Api, Evaluation-Server, and Data Analytic Service, are instrumented with OpenTelemetry to publish observability metrics, traces, and logs, enabling you to gain insights into FeatBit's performance and behavior.
Configuration
Basic Configuration
To enable OpenTelemetry, the following environment variables need to be set for each service:
ENABLE_OPENTELEMETRY: Tells the app that OpenTelemetry is enabled. Set totrueto enable OpenTelemetry.OTEL_SERVICE_NAME: This is used to identify the service in the observability backends. Set to the name of the service. For example,featbit-apifor the Api service,featbit-elsfor the Evaluation-Server service, andfeatbit-dasfor the Data Analytic service.OTEL_EXPORTER_OTLP_ENDPOINT: Sets the grpc endpoint of the OpenTelemetry exporter. For example:http://otel-collector:4317.
Additional Configuration
FeatBit's Api and Evaluation-Server services are written in .NET/C#, are instrumented with using .NET Automatic Instrumentation. For a complete list of supported environment variables, refer to the documentation.
The Data Analytic service, written in Python, is instrumented using the Python Automatic Instrumentation. For a complete list of supported environment variables, refer to the documentation.
A Ready-To-Run Example
We have a ready-to-run example for you to try out OpenTelemetry. In this example, we use Seq for logs, Jaeger for traces, and Prometheus for metrics.
Follow the steps below to run the example:
# Clone the repository
git clone https://github.com/featbit/featbit.git
cd featbit
# Build the test images
docker compose --project-directory . -f ./docker/composes/docker-compose-dev.yml build
# Start OTEL collector, Seq, Jaeger, and Prometheus
docker compose --project-directory . -f ./docker/composes/docker-compose-otel-collector-contrib.yml up -d
# Start FeatBit services
docker compose --project-directory . -f ./docker/composes/docker-compose-otel.yml up -dUse FeatBit as normal, create feature flags, evaluate flags, view flag insights, etc. Then
- View logs in Seq at http://localhost:8082
- View traces in Jaeger at http://localhost:16686
- View metrics in Prometheus at http://localhost:9090