Skip to content

MarkoMlakar/openfeature-dynatrace

Repository files navigation

OpenFeature with React, OpenTelemetry and Dynatrace [Work in progress]

Purpose

This repository showcases how to use OpenFeature and OpenTelemetry SDK in a React frontend application to send feature flag data to Dynatrace, where you can observe and monitor the changes in real-time.

A demonstration of OpenFeature integration with React, showing different feature flag providers and their connection to the Dynatrace platform for observability and monitoring.

Dynatrace Integration

The application sends feature flag change events to Dynatrace, allowing you to monitor and observe flag state changes in real-time through the Dynatrace Logs interface.

Dynatrace Feature Flags Logs

Implementation

This project demonstrates three different OpenFeature providers:

  1. Static In-Memory Provider - Feature flags stored in memory
  2. Static JSON Provider - Feature flags loaded from a static JSON file
  3. Flagd Provider - Feature flags served from a flagd instance running in Docker which can be toggled with a button click

Project Structure

  • src/components/ - React components for each provider
  • src/openFeature/ - Custom providers and hooks
  • flagd-provider/ - Docker configuration for flagd
  • proxy/ - Local proxy server for development

Getting Started

  1. Create environment configuration:

    Create a .env file in the root directory with your Dynatrace credentials:

    VITE_DYNATRACE_ENDPOINT=https://your-environment-id.live.dynatrace.com/api/v2/logs/ingest
    VITE_DYNATRACE_API_TOKEN=your-dynatrace-api-token
  2. Install dependencies:

    npm install
  3. Start the flagd provider:

    cd flagd-provider
    docker-compose up -d
  4. Run the development server with proxy:

    npm run dev:full

Roadmap

  • Complete OpenFeature integration
  • Complete OpenTelemetry integration
  • Connect to Dynatrace platform
  • Replace placeholder UI with a more polished one

Technologies Used

  • React 19.1.1
  • OpenFeature React SDK 1.0.1
  • OpenFeature Flagd Web Provider 0.7.3
  • Flagd 0.12.9 (Docker)
  • OpenTelemetry SDK 2.0.1
  • TypeScript 5.8.3
  • Vite 7.1.4
  • Node.js + Express 4.21.2 (Proxy Server - handles CORS and forwards logs to Dynatrace)
  • Chakra UI 3.0 (UI Component Library)

Client App

About

This project showcases simple examples on how OpenFeature can be used with OpenTelemetry and the Dynatrace platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors