Adds version support in the exporter

parent 5cbfbcb4
Pipeline #112332641 passed with stages
in 4 minutes and 52 seconds
#!/usr/bin/env sh
echo "Setting VERSION='${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}' in src/constants.py"
echo "VERSION = '${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}'" >> src/constants.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Constants declarations """
VERSION = None
......@@ -8,6 +8,7 @@ import pygelf
from stellar_sdk.server import Server
from prometheus_client import start_http_server
from prometheus_client.core import REGISTRY, GaugeMetricFamily
import constants
LOG = logging.getLogger(__name__)
logging.basicConfig(
......@@ -100,7 +101,8 @@ class StellarCollector:
if __name__ == '__main__':
configure_logging()
PORT = int(os.environ.get('PORT', 9188))
LOG.info("Starting on port {}".format(PORT))
# pylint: disable=no-member
LOG.info("Starting stellar-exporter {} on port {}".format(constants.VERSION, PORT))
REGISTRY.register(StellarCollector())
TEST = os.environ.get('TEST', False)
if not TEST:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment