Skip to content

Commit 6c88fdf

Browse files
committed
Add OpenTelemetry Bundle, Docker & Nix files
1 parent 5058252 commit 6c88fdf

34 files changed

+12400
-17
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../opentelemetry-bundle

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ max_line_length = 80
1717

1818
[COMMIT_EDITMSG]
1919
max_line_length = 0
20+
21+
[*.{yaml,yml,nix}]
22+
indent_size = 2

.env

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,12 @@ DATABASE_URL=sqlite:///%kernel.project_dir%/data/database.sqlite
2929
###< doctrine/doctrine-bundle ###
3030

3131
###> symfony/mailer ###
32-
# MAILER_DSN=null://null
32+
MAILER_DSN=smtp://localhost:1025
3333
###< symfony/mailer ###
34+
35+
###> symfony/messenger ###
36+
# Choose one of the transports below
37+
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
38+
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
39+
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
40+
###< symfony/messenger ###

.env.dev

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
# Define your env variables for the development environment here
2+
3+
###> symfony/framework-bundle ###
4+
APP_SECRET=8cb80353a0bf56b5bf86f64f5e3001f6
5+
###< symfony/framework-bundle ###

.envrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#! /usr/bin/env bash
2+
3+
cachix use nix-shell
4+
cachix use php-src-nix
5+
cachix use opentelemetry
6+
7+
use flake
8+
9+
export SASS_PATH=$(which sass)

.github/workflows/lint.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- opentelemetry-bundle
88

99
env:
1010
fail-fast: true
@@ -40,7 +40,7 @@ jobs:
4040
uses: shivammathur/setup-php@v2
4141
with:
4242
coverage: "none"
43-
extensions: intl
43+
extensions: "intl, mbstring, pdo_sqlite, zip, opentelemetry"
4444
php-version: ${{ matrix.php-version }}
4545
tools: composer:v2
4646

@@ -92,6 +92,7 @@ jobs:
9292
uses: shivammathur/setup-php@v2
9393
with:
9494
coverage: none
95+
extensions: "intl, mbstring, pdo_sqlite, zip, opentelemetry"
9596
php-version: '8.3'
9697

9798
- name: Install dependencies

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
push:
66
branches:
7-
- main
7+
- opentelemetry-bundle
88

99
env:
1010
fail-fast: true
@@ -39,7 +39,7 @@ jobs:
3939
uses: shivammathur/setup-php@v2
4040
with:
4141
coverage: "none"
42-
extensions: "intl, mbstring, pdo_sqlite, zip"
42+
extensions: "intl, mbstring, pdo_sqlite, zip, opentelemetry"
4343
php-version: ${{ matrix.php-version }}
4444
tools: composer:v2
4545

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
.php-version
55

6+
.direnv
7+
result
8+
.idea
9+
.data
10+
data/
11+
612
###> symfony/framework-bundle ###
713
/.env.local
814
/.env.local.php

OpenTelemetry.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# OpenTelemetry
2+
3+
This repository is based on Symfony's [demo](https://github.com/symfony/demo) application and integrates [opentelemetry-bundle](https://github.com/FriendsOfOpenTelemetry/opentelemetry-bundle).
4+
5+
To make things works with OpenTelemetry, this branch includes a Docker Composer file to configure and execute a functional OpenTelemetry environnement which includes:
6+
7+
- Tempo, to receive and store OpenTelemetry Traces
8+
- Prometheus, to receive OpenTelemetry Metrics
9+
- Loki, to receive OpenTelemetry Logs
10+
- Grafana, to visualize everything with all data sources configured
11+
12+
Any issues regarding OpenTelemetry integration should be reported on the opentelemetry-bundle repository [issues](https://github.com/FriendsOfOpenTelemetry/opentelemetry-bundle/issues).
13+
14+
## Requirements
15+
16+
- Nix
17+
- Docker
18+
19+
## Usage
20+
21+
Follow [ReadMe](./README.md#usage) to configure the application first.
22+
23+
Once the application is configured, you need to build a custom OpenTelemetry Collector using Nix:
24+
25+
```bash
26+
nix build .#otel-collector-image.copyToDockerDaemon
27+
./result/bin/copy-to-docker-daemon
28+
```
29+
30+
You should see our **otel-collector:latest** image when list images with Docker.
31+
32+
You can now launch our services with Docker:
33+
34+
```bash
35+
docker-compose up -d
36+
```
37+
38+
All services should be up and running. If not inspect logs of exited services.
39+
40+
Now you can browse any application pages and open Grafana (http://localhost:3000).
41+
42+
The default data sources is Tempo, so you should see traces by search any traces.
43+
44+
Here is a little video to show how it should look like:
45+
46+
https://github.com/user-attachments/assets/619b9c9a-88ed-439c-a368-4efa8202a268

assets/icons/symfony.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)