GithubHelp home page GithubHelp logo

gleam_opentelemetry_poc's Introduction

Gleam OpenTelemetry Proof-of-Concept Application

This PoC provides Erlang FFI for opentelemetry-erlang for a wisp backend and some JS FFI for OpenTelemetry as well for its lustre frontend.

After following the setup below, you should be able to browse to http://localhost:5173 in order to click a button - which will result in an HTTP GET that returns 500. Browsing to Jaeger at http://localhost:16686, you should be able see nested spans from frontend to backend.

Known Quirks

You will see this error starting up the backend:

OTLP exporter failed to initialize with exception error:{badmatch,
                                                         {error,
                                                          inets_not_started}}

glotel/tracing.init() takes care of this by forcing OTP applications to re-load and re-start in the right order.

Running Jaeger to Collect / View Metrics for Testing

docker run --rm --name jaeger \
  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \
  -e COLLECTOR_OTLP_HTTP_CORS_ALLOWED_HEADERS="*" \
  -e COLLECTOR_OTLP_HTTP_CORS_ALLOWED_ORIGINS="http://localhost:5173" \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 14250:14250 \
  -p 14268:14268 \
  -p 14269:14269 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.56

Running the Backend

cd backend
export OTEL_SERVICE_NAME="gleam_otel_poc_backend"
gleam run

Running the Frontend

cd frontend
npm i
export VITE_OTEL_SERVICE_NAME="gleam_otel_poc_frontend"
npm run dev

gleam_opentelemetry_poc's People

Contributors

skinkade avatar

Stargazers

Alex Manning avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.