Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(demo): add Grafana to demo environment #283

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
local/

.env-old
plugins
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ In demo/docker-compose.yml, set values for these keys.
The key `INFLUXDB_BUCKET_ARCHIVE` is optional;
if set, it should point to an InfluxDB bucket with longer retention policy than `INFLUXDB_BUCKET`,
so that the "Archive Trace" button in Jaeger works properly:
```yaml
INFLUXDB_ADDR: <region specific hostname - no https prefix>
INFLUXDB_BUCKET: otel
INFLUXDB_BUCKET_ARCHIVE: otel-archive
INFLUXDB_TOKEN: <the API token you just created>

The community addition focuses on the useability of the demo with Grafana. With this being said to improve demo setup we have introduced a `.env` file that will allow you to set the following variables:

```bash
INFLUXDB_ADDR=eu-central-1-1.aws.cloud2.influxdata.com
INFLUXDB_TOKEN=xxxxxxx
INFLUXDB_ORG=xxxxxxxx
INFLUXDB_BUCKET=otel
INFLUXDB_BUCKET_ARCHIVE=otel-archive
```

In demo/otelcol-config.yml, set the similar values for these keys:
Expand All @@ -29,7 +33,7 @@ token: <the API token you just created>

Run the docker compose:
```console
$ docker compose --file demo/docker-compose.yml --project-directory . up --abort-on-container-exit --remove-orphans
$ docker-compose --file demo/docker-compose.yml --project-directory . up --abort-on-container-exit --remove-orphans
```

Traces are generated by "HotRod", an application designed to demonstrate tracing.
Expand All @@ -43,6 +47,13 @@ Click any trace.
View the dependency graph.
Click "System Architecture".

Grafana is available at http://localhost:3000. The default username and password are both `admin`. The default datasource of flightSQL is already confgiured.

**Note: You can find a dashboard to import under `demo/grafana/dashboards/Open Telemetry-1681814438598.json`**

If you would like to access the Trace node tree. Then Make sure to enable it within the Jaeger datasource. Head to data sources and click on the Jaeger datasource. Then enable `Enable Node Graph`. Then click save and test.


The images `otelcol-influxdb` and `jaeger-influxdb` are automatically built and pushed to Docker at https://hub.docker.com/r/jacobmarble/otelcol-influxdb and https://hub.docker.com/r/jacobmarble/jaeger-influxdb .

## Schema Reference
Expand Down
5 changes: 5 additions & 0 deletions demo/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INFLUXDB_ADDR=eu-central-1-1.aws.cloud2.influxdata.com
INFLUXDB_TOKEN=xxxxxxxx
INFLUXDB_ORG=xxxxxxx
INFLUXDB_BUCKET=otel
INFLUXDB_BUCKET_ARCHIVE=
33 changes: 22 additions & 11 deletions demo/docker-compose-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
depends_on:
- jaeger-influxdb
environment:
#QUERY_BEARER_TOKEN_PROPAGATION: true
LOG_LEVEL: warn
SPAN_STORAGE_TYPE: grpc-plugin
GRPC_STORAGE_SERVER: jaeger-influxdb:17271
Expand All @@ -27,17 +26,11 @@ services:
image: jaeger-influxdb:local
stop_grace_period: 10s
environment:
LOG_LEVEL: info
LOG_LEVEL: debug
LISTEN_ADDR: :17271
INFLUXDB_TIMEOUT: 30s
# required: hostname or hostname:port
INFLUXDB_ADDR:
# required: bucket name
INFLUXDB_BUCKET: otel
# optional: bucket name for archived traces
INFLUXDB_BUCKET_ARCHIVE:
# required
INFLUXDB_TOKEN:
env_file:
- demo/.env

hotrod:
build:
Expand All @@ -47,18 +40,36 @@ services:
stop_grace_period: 1s
ports:
- "8080:8080" # web UI
- "8083:8083"
depends_on:
- otelcol-influxdb
environment:
JAEGER_AGENT_HOST: otelcol-influxdb
JAEGER_AGENT_PORT: 6831
command: ["all", "-m", "prometheus"]

otelcol-influxdb:
build:
context: .
dockerfile: otelcol-influxdb/Dockerfile
image: otelcol-influxdb:local
command: [ "--config", "/config.yml" ]
command: ["--config", "/config.yml"]
stop_grace_period: 10s
volumes:
- ./demo/otelcol-config.yml:/config.yml:ro
env_file:
- demo/.env

grafana:
image: grafana/grafana:latest
ports:
- "3000:3000" # web UI
environment:
- INFLUX_HOST=${INFLUXDB_ADDR}
- INFLUX_TOKEN=${INFLUXDB_TOKEN}
- INFLUX_ORG=${INFLUXDB_ORG}
- INFLUX_BUCKET=${INFLUXDB_BUCKET}
- GF_INSTALL_PLUGINS=influxdata-flightsql-datasource
volumes:
- ./demo/grafana/datasources:/etc/grafana/provisioning/datasources:ro
- ./demo/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
34 changes: 23 additions & 11 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
depends_on:
- jaeger-influxdb
environment:
LOG_LEVEL: info
LOG_LEVEL: warn
SPAN_STORAGE_TYPE: grpc-plugin
GRPC_STORAGE_SERVER: jaeger-influxdb:17271
GRPC_STORAGE_CONNECTION_TIMEOUT: 30s
Expand All @@ -19,35 +19,47 @@ services:
- ./demo/jaeger-ui-config.json:/jaeger-ui-config.json:ro

jaeger-influxdb:
image: jacobmarble/jaeger-influxdb:0.5.2
image: jacobmarble/jaeger-influxdb:0.5.8
stop_grace_period: 10s
environment:
LOG_LEVEL: info
LISTEN_ADDR: :17271
INFLUXDB_TIMEOUT: 30s
# required: hostname or hostname:port
INFLUXDB_ADDR:
# required: bucket name
INFLUXDB_BUCKET: otel
# optional: bucket name for archived traces
INFLUXDB_BUCKET_ARCHIVE:
# required
INFLUXDB_TOKEN:
env_file:
- demo/.env

hotrod:
image: jaegertracing/example-hotrod:1.41
stop_grace_period: 1s
ports:
- "8080:8080" # web UI
- "8083:8083"
depends_on:
- otelcol-influxdb
environment:
JAEGER_AGENT_HOST: otelcol-influxdb
JAEGER_AGENT_PORT: 6831
command: ["all", "-m", "prometheus"]

otelcol-influxdb:
image: otel/opentelemetry-collector-contrib:0.85.0
command: [ "--config", "/config.yml" ]
command: ["--config", "/config.yml"]
stop_grace_period: 10s
volumes:
- ./demo/otelcol-config.yml:/config.yml:ro
env_file:
- demo/.env

grafana:
image: grafana/grafana:latest
ports:
- 3000:3000
environment:
- INFLUX_HOST=${INFLUXDB_ADDR}
- INFLUX_TOKEN=${INFLUXDB_TOKEN}
- INFLUX_ORG=${INFLUXDB_ORG}
- INFLUX_BUCKET=${INFLUXDB_BUCKET}
- GF_INSTALL_PLUGINS=influxdata-flightsql-datasource
volumes:
- ./demo/grafana/datasources:/etc/grafana/provisioning/datasources:ro
- ./demo/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
Loading
Loading