Skip to content
This repository was archived by the owner on Feb 16, 2020. It is now read-only.

Commit 03f0810

Browse files
committed
Adds version information to the running exporter
1 parent 6e22002 commit 03f0810

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
echo "Setting VERSION='${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}' in src/constants.py"
4+
echo "VERSION = '${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}'" >> src/constants.py

src/__init__.py

Whitespace-only changes.

src/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
""" Constants declarations """
4+
5+
VERSION = None

src/etherscan-exporter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pygelf
1111
from prometheus_client import start_http_server
1212
from prometheus_client.core import REGISTRY, GaugeMetricFamily
13+
import constants
1314

1415
LOG = logging.getLogger(__name__)
1516
logging.basicConfig(
@@ -163,7 +164,8 @@ def collect(self):
163164
if __name__ == '__main__':
164165
configure_logging()
165166
PORT = int(os.environ.get('PORT', 9308))
166-
LOG.info("Starting on port {}".format(PORT))
167+
# pylint: disable=no-member
168+
LOG.info("Starting etherscan-exporter {} on port {}".format(constants.VERSION, PORT))
167169
REGISTRY.register(EtherscanCollector())
168170
start_http_server(PORT)
169171
while True:

0 commit comments

Comments
 (0)