Skip to content

Commit

Permalink
Adding support for WATCHER_SCALYR_SERVER
Browse files Browse the repository at this point in the history
This is an exact replica of zalando-incubator#51.
  • Loading branch information
Felix Mueller committed Dec 6, 2017
1 parent e86e7da commit 2c1155b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kube_log_watcher/agents/scalyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class ScalyrAgent(BaseWatcher):
def __init__(self, cluster_id: str, load_template):
self.api_key = os.environ.get('WATCHER_SCALYR_API_KEY')
self.dest_path = os.environ.get('WATCHER_SCALYR_DEST_PATH')
self.scalyr_server = os.environ.get('WATCHER_SCALYR_SERVER'):144

if not all([self.api_key, self.dest_path]):
raise RuntimeError('Scalyr watcher agent initialization failed. Env variables WATCHER_SCALYR_API_KEY and '
Expand Down Expand Up @@ -142,6 +143,7 @@ def flush(self):
'cluster_id': self.cluster_id,
'logs': self.logs,
'monitor_journald': self.journald,
'scalyr_server': self.scalyr_server,
}

current_paths = self._get_current_log_paths()
Expand Down
4 changes: 4 additions & 0 deletions kube_log_watcher/templates/scalyr.json.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"serverHost": "{{ cluster_id }}"
},

{% if scalyr_server %}
"scalyr_server": "{{ scalyr_server }}",
{% endif %}

"logs": [
{% for log in logs %}
{
Expand Down

0 comments on commit 2c1155b

Please sign in to comment.