-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Add all-in-one Docker Compose and Grafana configuration #997
Changes from 8 commits
ee45f83
7784114
12898bf
34a6ace
957f0c2
b1e5b64
203aba8
d7908d5
dd4180f
848a74c
05908fe
6e5f273
a11a695
74ca981
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
version: '3.3' | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: prometheus | ||
ports: | ||
- '9090:9090' | ||
command: | ||
- --config.file=/etc/prometheus/prometheus.yml | ||
volumes: | ||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro | ||
grafana: | ||
image: grafana/grafana:latest | ||
container_name: grafana | ||
ports: | ||
- '3000:3000' | ||
command: | ||
- --config=/etc/grafana/grafana.ini | ||
volumes: | ||
- ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml:ro | ||
- ./grafana/grafana.ini:/etc/grafana/grafana.ini:ro | ||
- ./grafana/datasources.yml:/etc/grafana/provisioning/datasources/datasources.yml:ro | ||
depends_on: | ||
- prometheus | ||
mongo: | ||
image: mongo:latest | ||
container_name: mongo | ||
restart: always | ||
ports: | ||
- '27017:27017' | ||
yorkie: | ||
build: | ||
context: ../../ | ||
dockerfile: Dockerfile | ||
container_name: 'yorkie' | ||
command: | ||
[ | ||
'server', | ||
'--mongo-connection-uri', | ||
'mongodb://mongo:27017', | ||
'--enable-pprof', | ||
] | ||
restart: always | ||
ports: | ||
- '8080:8080' | ||
- '8081:8081' | ||
depends_on: | ||
- mongo | ||
krapie marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||||||
# Grafana Setup Guide | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
## Importing Dashboards | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
To import dashboards into Grafana, follow these steps: | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
1. Open Grafana in your browser (http://localhost:3000). | ||||||||||||||||||||||||||||||||||||
2. Log in with the default credentials (admin/admin). | ||||||||||||||||||||||||||||||||||||
3. Click "Dashboards" in the left sidebar. | ||||||||||||||||||||||||||||||||||||
4. Click "New" and then "Import". | ||||||||||||||||||||||||||||||||||||
5. Use the Yorkie dashboard ID `18560` to import the dashboard. | ||||||||||||||||||||||||||||||||||||
6. Click "Load" and "Import" and the dashboard will be made. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify and enhance dashboard import instructions. The instructions for importing dashboards are clear and concise. However, to comply with Markdown best practices, consider linking the URL text instead of using a bare URL. This enhancement improves readability and user experience. Suggested change for the bare URL: -1. Open Grafana in your browser (http://localhost:3000).
+1. Open Grafana in your browser ([http://localhost:3000](http://localhost:3000)). Committable suggestion
Suggested change
ToolsMarkdownlint
|
||||||||||||||||||||||||||||||||||||
## Setting a Default Dashboard | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
If you want to set a default dashboard, follow these steps: | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
1. Open the [Yorkie dashboard](https://grafana.com/grafana/dashboards/18560). | ||||||||||||||||||||||||||||||||||||
2. Download the dashboard JSON file. | ||||||||||||||||||||||||||||||||||||
3. Paste the contents into `build/docker/grafana/yorkie_dashboard.json`. | ||||||||||||||||||||||||||||||||||||
4. Mount the docker volume to the Grafana container by adding the following line to your `docker-compose.yml` file: | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
```yaml | ||||||||||||||||||||||||||||||||||||
volumes: | ||||||||||||||||||||||||||||||||||||
- ./grafana/your_dashboard_name.json:/var/lib/grafana/your_dashboard_name.json:ro | ||||||||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
You can import other dashboards by following the same steps. | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enhance instructions for setting a default dashboard. The steps for setting a default dashboard are well-detailed. However, to avoid confusion, consider specifying the exact location of the Suggested improvements: -4. Mount the docker volume to the Grafana container by adding the following line to your `docker-compose.yml` file:
+4. Mount the docker volume to the Grafana container by adding the following line to your `docker-compose.yml` file located at `build/docker/`:
```yaml
volumes:
- - ./grafana/your_dashboard_name.json:/var/lib/grafana/your_dashboard_name.json:ro
+ - ./grafana/yorkie_dashboard.json:/var/lib/grafana/yorkie_dashboard.json:ro
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: 1 | ||
krapie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
providers: | ||
- name: 'dashboards' | ||
orgId: 1 | ||
folder: '' | ||
folderUid: '' | ||
type: file | ||
disableDeletion: true | ||
updateIntervalSeconds: 10 | ||
allowUiUpdates: true | ||
options: | ||
path: /var/lib/grafana | ||
foldersFromFilesStructure: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: Prometheus | ||
type: prometheus | ||
access: proxy | ||
url: http://prometheus:9090 | ||
isDefault: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[paths] | ||
provisioning = /etc/grafana/provisioning | ||
|
||
[server] | ||
http_port = 3000 | ||
|
||
[security] | ||
admin_user = admin | ||
admin_password = admin | ||
|
||
[users] | ||
allow_sign_up = true | ||
|
||
[auth.anonymous] | ||
enabled = false | ||
|
||
[dashboards] | ||
versions_to_keep = 20 | ||
|
||
[unified_alerting] | ||
enabled = true | ||
krapie marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the deployment process in the new section.
The addition of the
docker-compose-deploy.yml
file is well-documented. However, to enhance clarity and usability:Additionally, address the punctuation issue flagged by the static analysis tool:
docker-compose-deploy.yml
" could be replaced with a colon for better readability and to match the style of documentation.Would you like me to draft a more detailed explanation or example usage for this section?
Tools
LanguageTool