Permalink
Browse files

Merge 1e37185 into 6064bfc

  • Loading branch information...
shintasmith committed Jun 1, 2017
2 parents 6064bfc + 1e37185 commit 24221ec0688b2df003f399bc4090066cd60a9828
@@ -1,36 +0,0 @@
FROM python:2.7
MAINTAINER gaurav.bajaj@rackspace.com
RUN apt-get update -y --force-yes && \
apt-get -y --no-install-recommends install libfontconfig curl ca-certificates && \
apt-get clean && \
curl https://grafanarel.s3.amazonaws.com/builds/grafana_2.6.0_amd64.deb > /tmp/grafana.deb && \
dpkg -i /tmp/grafana.deb && \
rm /tmp/grafana.deb && \
curl -L https://github.com/tianon/gosu/releases/download/1.7/gosu-amd64 > /usr/sbin/gosu && \
chmod +x /usr/sbin/gosu && \
apt-get remove -y curl && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y git --force-yes && \
apt-get install -y build-essential --force-yes && \
apt-get install -y libcairo2-dev --force-yes && \
apt-get install -y libffi-dev --force-yes && \
pip install gunicorn &&\
pip install --upgrade "git+http://github.com/rackerlabs/graphite-api.git@1.1.3-rax.1" &&\
git -C /tmp clone https://github.com/rackerlabs/blueflood.git &&\
git -C /tmp/blueflood checkout master &&\
cd /tmp/blueflood/contrib/graphite &&\
python setup.py install
VOLUME ["/var/lib/grafana", "/var/lib/grafana/plugins", "/var/log/grafana", "/etc/grafana"]
EXPOSE 3000
EXPOSE 8888
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
@@ -1,36 +0,0 @@
# Description:
Docker Container to run Grafana - 2.6.0 on Blueflood / Rackspace Metrics.
# Building / Pulling:
docker build -t goru97/grafana-blueflood . </BR>
or </BR>
docker pull goru97/grafana-blueflood
# Running:
### With local Blueflood Setup:
docker run -p 3000:3000 -e BLUEFLOOD_QUERY_URL=<YOUR_BLUEFLOOD_URL> -e TENANT_ID=<YOUR_TENANT_ID> goru97/grafana-blueflood
### With Rackspace Metrics:
docker run -p 3000:3000 -e BLUEFLOOD_QUERY_URL=https://global.metrics.api.rackspacecloud.com -e TENANT_ID=$YOUR_TENANT_ID -e RAX_USERNAME=$YOUR_RACKSPACE_USERNAME -e RAX_APIKEY=$YOUR_RACKSPACE_APIKEY goru97/grafana-blueflood
## Setting Up Grafana:
* Sign - Up
* Add Organization
* Add API-Key for role-based access / To use HTTP-APIs
* Add Datasource (Option 1 - Using GUI):
* Add Blueflood as name of the datasource
* Select Graphite as the Type
* Set the URL to http://localhost:8888
* Add Datasource (Option 2 - Using CURL):
```
curl -H "Content-Type: application/json" -H "Authorization: Bearer <API-KEY-FROM-GUI>" -X POST -d '{ "name":"Blueflood", "type":"graphite", "url":"http://localhost:8888", "access":"proxy", "basicAuth":false }' http://grafana-host:3000/api/datasources
```
@@ -1,61 +0,0 @@
#!/bin/bash -x
: ${BLUEFLOOD_QUERY_URL="http://localhost:20000"}
: ${TENANT_ID="123"}
exec 2>&1
exec 1>/tmp/bash-debug.log
apt-get update -y --force-yes
if [[ -z "$RAX_USERNAME" ]] || [[ -z "$RAX_APIKEY" ]]
then
cat > /etc/graphite-api.yaml << EOL
search_index: /dev/null
finders:
- blueflood.TenantBluefloodFinder
functions:
- graphite_api.functions.SeriesFunctions
- graphite_api.functions.PieFunctions
time_zone: UTC
blueflood:
tenant: $TENANT_ID
urls:
- $BLUEFLOOD_QUERY_URL
EOL
else
cat > /etc/graphite-api.yaml << EOL
search_index: /dev/null
finders:
- blueflood.TenantBluefloodFinder
functions:
- graphite_api.functions.SeriesFunctions
- graphite_api.functions.PieFunctions
time_zone: UTC
blueflood:
tenant: $TENANT_ID
username: $RAX_USERNAME
apikey: $RAX_APIKEY
authentication_module: rax_auth
authentication_class: BluefloodAuth
enable_submetrics: true
submetric_aliases: { "_sum": 'sum' }
urls:
- $BLUEFLOOD_QUERY_URL
EOL
fi
exec gunicorn -b 127.0.0.1:8888 --access-logfile /var/log/gunicorn-access.log --error-logfile /var/log/gunicorn-error.log -w 8 graphite_api.app:app &
: "${GF_PATHS_DATA:=/var/lib/grafana}"
: "${GF_PATHS_LOGS:=/var/log/grafana}"
: "${GF_PATHS_PLUGINS:=/var/lib/grafana/plugins}"
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_LOGS"
chown -R grafana:grafana /etc/grafana
exec gosu grafana /usr/sbin/grafana-server \
--homepath=/usr/share/grafana \
--config=/etc/grafana/grafana.ini \
cfg:default.paths.data="$GF_PATHS_DATA" \
cfg:default.paths.logs="$GF_PATHS_LOGS" \
cfg:default.paths.plugins="$GF_PATHS_PLUGINS"

0 comments on commit 24221ec

Please sign in to comment.