...
 
Commits (3)
variables:
DOCKER_DRIVER: overlay2
PORT: 9308
DOCKERHUB_REPO_PREFIX: ixdotai
DOCKERHUB_REPO_NAME: crypto-exporter
......
FROM alpine:latest
LABEL maintainer="docker@ix.ai"
ARG PORT=9308
ARG LOGLEVEL=INFO
WORKDIR /app
COPY src/ /app
......@@ -13,8 +10,6 @@ RUN apk --no-cache upgrade && \
pip3 install --no-cache-dir -r requirements.txt && \
apk del --purge --no-cache gcc musl-dev python3-dev libffi-dev openssl-dev
ENV LOGLEVEL=${LOGLEVEL} PORT=${PORT}
EXPOSE ${PORT}
EXPOSE 9188
ENTRYPOINT ["python3", "/app/exporter.py"]
......@@ -88,14 +88,16 @@ Make sure that your prometheus server is able to reach the network set for the c
**Warning**: some exchanges (notably: gdax/coinbasepro) need more than 30s to scrape
### Supported variables
* `EXCHANGE` (no default - **mandatory**) - see below
* `API_KEY` (no default) - set this to your Exchange API key
* `API_SECRET` (no default) - set this to your Exchange API secret
* `API_UID` (no default) - only needed for certain exchanges (like `cex`)
* `GELF_HOST` (no default) - if set, the exporter will also log to this [GELF](https://docs.graylog.org/en/3.0/pages/gelf.html) capable host on UDP
* `GELF_PORT` (defaults to `12201`) - the port to use for GELF logging
* `PORT` (defaults to `9308`) - the listen port for the exporter
* `LOGLEVEL` (defaults to `INFO`)
| **Variable** | **Default** | **Mandatory** | **Description** |
|:--------------|:-----------:|:-------------:|:-----------------------------------------------------------------------------------------------------------------------|
| `EXCHANGE` | - | **YES** | see below |
| `API_KEY` | - | NO | set this to your Exchange API key |
| `API_SECRET` | - | NO | set this to your Exchange API secret |
| `API_SECRET` | - | NO | only needed for certain exchanges (like `cex`) |
| `LOGLEVEL` | `INFO` | NO | [Logging Level](https://docs.python.org/3/library/logging.html#levels) |
| `GELF_HOST` | - | NO | if set, the exporter will also log to this [GELF](https://docs.graylog.org/en/3.0/pages/gelf.html) capable host on UDP |
| `GELF_PORT` | `12201` | NO | Ignored, if `GELF_HOST` is unset. The UDP port for GELF logging |
| `PORT` | `9188` | NO | The port for prometheus metrics |
### Supported (tested) exchanges
* poloniex
......
......@@ -195,7 +195,7 @@ class CryptoCollector():
if __name__ == '__main__':
configure_logging()
PORT = int(os.environ.get('PORT', 9308))
PORT = int(os.environ.get('PORT', 9188))
LOG.info("Starting on port {}".format(PORT))
REGISTRY.register(CryptoCollector())
start_http_server(PORT)
......
ccxt<=1.18.1102
ccxt==1.18.1122
prometheus_client==0.7.1
requests==2.22.0
pygelf
prometheus_client
requests