Skip to content

Commit

Permalink
Merge pull request #99 from zalando/fix-metrics2
Browse files Browse the repository at this point in the history
Use valid lizzy tag value
  • Loading branch information
jmcs committed Mar 2, 2017
2 parents 754eab7 + 9f4f593 commit a4aff0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion lizzy_client/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
This module only works if metricz is installed
"""

from urllib.parse import urlparse

try:
import metricz
except ImportError:
Expand All @@ -23,9 +25,15 @@ def report_metric(metric_name: str, value: int, fail_silently: bool=True):

configuration = Configuration()

try:
lizzy_domain = urlparse(configuration.lizzy_url).netloc
lizzy_name, _ = lizzy_domain.split('.', 1)
except:
lizzy_name = 'UNKNOWN'

tags = {
'version': VERSION,
'lizzy': configuration.lizzy_url
'lizzy': configuration.lizzy_name
}

# noinspection PyBroadException
Expand Down
2 changes: 1 addition & 1 deletion lizzy_client/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MAJOR_VERSION = 2
MINOR_VERSION = 7
REVISION = 1
REVISION = 2
VERSION = "{MAJOR_VERSION}.{MINOR_VERSION}.{REVISION}".format_map(locals())

0 comments on commit a4aff0f

Please sign in to comment.