-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metrics: deduplicate code in examples (#2404)
* Dedup code in metrics examples * Readme tweaks * Remove unused code * Remove unused code * Use extra_hosts for grafana on linux
- Loading branch information
Showing
12 changed files
with
21 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,12 @@ | ||
version: "3.7" | ||
services: | ||
prometheus: | ||
image: prom/prometheus:latest | ||
ports: | ||
- "9090:9090" | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
network_mode: "host" | ||
extra_hosts: # define a host.docker.internal alias, so we can use the same datasources.yml and prometheus.yml on Linux and OSX | ||
extra_hosts: | ||
# define a host.docker.internal alias, so we can use the same prometheus.yml on Linux and macOS | ||
- "host.docker.internal:127.0.0.1" | ||
grafana: | ||
image: grafana/grafana:latest | ||
depends_on: | ||
- prometheus | ||
ports: | ||
- "3000:3000" | ||
network_mode: "host" | ||
extra_hosts: # define a host.docker.internal alias, so we can use the same datasources.yml and prometheus.yml on Linux and OSX | ||
- "host.docker.internal:127.0.0.1" | ||
environment: | ||
- GF_AUTH_DISABLE_LOGIN_FORM=true | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
volumes: | ||
- ./dashboard.yml:/etc/grafana/provisioning/dashboards/main.yml | ||
- ./datasources.yml:/etc/grafana/provisioning/datasources/prom.yml | ||
- ./autonat/autonat.json:/var/lib/grafana/dashboards/autonat.json | ||
- ./autorelay/autorelay.json:/var/lib/grafana/dashboards/autorelay.json | ||
- ./eventbus/eventbus.json:/var/lib/grafana/dashboards/eventbus.json | ||
- ./holepunch/holepunch.json:/var/lib/grafana/dashboards/holepunch.json | ||
- ./identify/identify.json:/var/lib/grafana/dashboards/identify.json | ||
- ./relaysvc/relaysvc.json:/var/lib/grafana/dashboards/relaysvc.json | ||
- ./swarm/swarm.json:/var/lib/grafana/dashboards/swarm.json | ||
extra_hosts: | ||
# define a prometheus alias, so we can use the same datasources.yml on Linux and macOS | ||
- "prometheus:127.0.0.1" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,15 @@ | ||
services: | ||
|
||
prometheus-server: | ||
prometheus: | ||
image: prom/prometheus:latest | ||
restart: unless-stopped | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/etc/prometheus/console_libraries' | ||
- '--web.console.templates=/etc/prometheus/consoles' | ||
- '--web.enable-lifecycle' | ||
ports: | ||
- 9090:9090 | ||
expose: | ||
- 9090 | ||
|
||
grafana: | ||
# image: sha256:b4cfd1a8f2d221019265ca75b20e066b5ddd34631210441d5877914a0af2fd67 | ||
build: | ||
dockerfile: examples/metrics-and-dashboards/grafana.Dockerfile | ||
context: ../../ | ||
environment: | ||
- GF_AUTH_DISABLE_LOGIN_FORM=true | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- "9090:9090" | ||
volumes: | ||
- ./grafana-config/grafana.ini:/etc/grafana/grafana.ini | ||
- ./grafana-config/provisioning:/etc/grafana/provisioning | ||
ports: | ||
- 3000:3000 | ||
|
||
- ../examples/metrics-and-dashboards/prometheus.yml:/etc/prometheus/prometheus.yml | ||
go-libp2p-node: | ||
build: | ||
context: . | ||
context: ../examples/metrics-and-dashboards/ | ||
dockerfile: go-libp2p-node.Dockerfile | ||
ports: | ||
- 2112:2112 | ||
- 5001:5001 | ||
expose: | ||
- 2112 | ||
- 5001 |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
examples/metrics-and-dashboards/grafana-config/provisioning/dashboards/dashboards.yml
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
examples/metrics-and-dashboards/grafana-config/provisioning/datasources/datasource.yml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters