Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Commit

Permalink
[prometheus] Add zipkin_collector metrics to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
abesto committed Jun 12, 2017
1 parent 64d5f66 commit a7a12e8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
12 changes: 7 additions & 5 deletions prometheus/create-datasource-and-dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ fi
dashboard_id=1598
last_revision=$(curl -sf https://grafana.com/api/dashboards/${dashboard_id}/revisions | grep '"revision":' | sed 's/ *"revision": \([0-9]*\),/\1/' | sort -n | tail -1)

curl -s https://grafana.com/api/dashboards/${dashboard_id}/revisions/${last_revision}/download | \
xargs -0 -I "{}" curl --retry-connrefused --retry 5 --retry-delay 0 -sf \
-X POST -H "Content-Type: application/json" \
--data-binary '{"dashboard": {}, "inputs": [{"name": "DS_PROM", "pluginId": "prometheus", "type": "datasource", "value": "prom"}], "overwrite": false}' \
http://grafana:3000/api/dashboards/import
echo '{"dashboard": ' > data.json
curl -s https://grafana.com/api/dashboards/${dashboard_id}/revisions/${last_revision}/download >> data.json
echo ', "inputs": [{"name": "DS_PROM", "pluginId": "prometheus", "type": "datasource", "value": "prom"}], "overwrite": false}' >> data.json
curl --retry-connrefused --retry 5 --retry-delay 0 -sf \
-X POST -H "Content-Type: application/json" \
--data-binary @data.json \
http://grafana:3000/api/dashboards/import
9 changes: 9 additions & 0 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ scrape_configs:
regex: '^response_(.*)$'
replacement: 'http_request_duration_milliseconds'
target_label: __name__
# Received message count
- source_labels: [__name__]
regex: 'zipkin_collector_(.*)_([^_]*)'
replacement: '${2}'
target_label: transport
- source_labels: [__name__]
regex: 'zipkin_collector_(.*)_([^_]*)'
replacement: 'zipkin_collector_${1}'
target_label: __name__

0 comments on commit a7a12e8

Please sign in to comment.