Skip to content

Files

Latest commit

 

History

History

phoenix

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Instrumenting Phoenix application with OpenTelemetry

  1. Open this directory in your terminal.

  2. Install the project dependencies using the following command:

mix deps.get
  1. Run the docker-compose file to start the Postgres database:
docker-compose up -d --build
  1. Obtain the OTLP Auth Header from the Last9 dashboard. The Auth header is required in the next steps.

  2. Next, run the commands below to set the environment variables.

export OTEL_SERVICE_NAME=phoenix-app-service
export OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.last9.io
export OTEL_EXPORTER_OTLP_AUTH_HEADER="Basic <BASIC_AUTH_HEADER>"
  1. Run the Phoenix application:
mix phx.server
  1. Once the server is running, you can access the application at http://localhost:4000 by default. You can go to the /users route to start interacting with the application.

  2. Go to the Last9 dashboard to view the traces.

Image