This is an Angular project for introducing observability concepts in Front-end Applcations through Grafana Stack
- Angular 17
- Docker
- Grafana Alloy
- Grafana Faro SDK
- Grafana Loki
- Grafana Tempo
- Make sure you have docker and docker compose installed
- Navigate to
observability/
directory - Raise de containers by running
docker compose up
- Make sure you have Angular CLI installed
- Install the projects dependencies by running
npm install
or the equivalent installation command of your package manager - Raise the Angular application by running
npm start
- Open
http://localhost:3000
on your browser; - On Grafana UI side Menu, go to data source > add new data source > search for loki;
- After that, in Grafana Loki settings connection field, type Grafana Loki endpoint:
http://loki:3100
and click on "Save and Test" button; - You might see a green alert message indicating the connection succeed
- Open
http://localhost:3000
on your browser; - On Grafana UI side Menu, go to data source > add new data source > search for tempo;
- After that, in Grafana Tempo settings connection field, type Grafana Loki endpoint:
http://tempo:3200
and click on "Save and Test" button; - You might see a green alert message indicating the connection succeed
Even thought, with the previous configurations, you are already able to see logs and traces in Grafana UI, you also can also see your data throught a graphic dashboard, for that, just:
- Open
http://localhost:3000
on your browser; - On Grafana UI side menu, go to Dashboards;
- In a new tab, open the link https://github.com/grafana/faro-web-sdk/blob/main/dashboards/frontend-application.json, and make the download of the json file;
- After that, return to grafana ui dashboards > click "new" button > "New Dashboard"
- Next, click on "Import Dashboard" button and make de upload of the previously downloaded json file;
- After, select the Loki data source on logs input field and click import.
It's also possible to define these data sources and dashboards previously with proper initialization config, but this could be future talk!
Now everything its up and running, interact with the Angular application for a while, after go the dashboard you created to see the data, that's all!
Thanks for reading! 😉