-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix_lint4
- Loading branch information
Showing
20 changed files
with
194 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/bin/sh | ||
|
||
: ${SLEEP_LENGTH:=2} | ||
: "${SLEEP_LENGTH:=2}" | ||
|
||
wait_for() { | ||
echo Waiting for $1 to listen on $2... | ||
while ! nc -z $1 $2; do echo sleeping; sleep $SLEEP_LENGTH; done | ||
echo "Waiting for $1 to listen on $2..." | ||
while ! nc -z "$1" "$2"; do echo sleeping; sleep "$SLEEP_LENGTH"; done | ||
} | ||
|
||
for var in "$@" | ||
do | ||
host=${var%:*} | ||
port=${var#*:} | ||
wait_for $host $port | ||
wait_for "$host" "$port" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* global _ */ | ||
|
||
/* | ||
* Complex scripted dashboard | ||
* This script generates a dashboard object that Grafana can load. It also takes a number of user | ||
* supplied URL parameters (in the ARGS variable) | ||
* | ||
* Return a dashboard object, or a function | ||
* | ||
* For async scripts, return a function, this function must take a single callback function as argument, | ||
* call this callback function with the dashboard object (see scripted_async.js for an example) | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// accessible variables in this scope | ||
var window, document, ARGS, $, jQuery, moment, kbn; | ||
|
||
// Setup variables | ||
var dashboard, timespan; | ||
|
||
// All url parameters are available via the ARGS object | ||
var ARGS; | ||
|
||
// Set a default timespan if one isn't specified | ||
timespan = '1d'; | ||
|
||
// keys which should not be dimensions | ||
var exclusion_keys = [ | ||
'metric', | ||
'type', | ||
'slug', | ||
'fullscreen', | ||
'edit', | ||
'panelId', | ||
'from', | ||
'to' | ||
]; | ||
|
||
// Intialize a skeleton with nothing but a rows array and service object | ||
dashboard = { | ||
rows : [], | ||
}; | ||
|
||
// Set a title | ||
dashboard.title = 'Alarm drilldown'; | ||
dashboard.time = { | ||
from: "now-" + (ARGS.from || timespan), | ||
to: "now" | ||
}; | ||
|
||
var metricName = 'metricname'; | ||
|
||
if(!_.isUndefined(ARGS.metric)) { | ||
metricName = ARGS.metric; | ||
} | ||
|
||
// Set dimensions | ||
var dimensions = []; | ||
for (var key in ARGS) { | ||
if (exclusion_keys.indexOf(key) == -1) { | ||
dimensions.push({'key': key, 'value': ARGS[key]}); | ||
} | ||
} | ||
|
||
dashboard.rows.push({ | ||
title: 'Chart', | ||
height: '300px', | ||
panels: [ | ||
{ | ||
title: metricName, | ||
type: 'graph', | ||
span: 12, | ||
fill: 1, | ||
linewidth: 2, | ||
targets: [ | ||
{ | ||
"metric": metricName, | ||
"aggregator": "avg", | ||
"period": 300, | ||
"dimensions": dimensions | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
|
||
return dashboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
python /template.py /etc/grafana/grafana.ini.j2 /etc/grafana/grafana.ini | ||
/go/bin/grafana-server -config /etc/grafana/grafana.ini -homepath /var/lib/grafana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python | ||
|
||
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
from __future__ import print_function | ||
|
||
import os | ||
import sys | ||
|
||
from jinja2 import Template | ||
|
||
|
||
def main(): | ||
if len(sys.argv) != 3: | ||
print('Usage: {} [input] [output]'.format(sys.argv[0])) | ||
sys.exit(1) | ||
|
||
in_path = sys.argv[1] | ||
out_path = sys.argv[2] | ||
|
||
with open(in_path, 'r') as in_file, open(out_path, 'w') as out_file: | ||
t = Template(in_file.read()) | ||
out_file.write(t.render(os.environ)) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
monasca-kibana-plugin.auth_uri: http://{{ KEYSTONE_URI }} | ||
monasca-kibana-plugin.enabled: {{ MONASCA_PLUGIN_ENABLED }} | ||
monasca-kibana-plugin.cookie.isSecure: False | ||
elasticsearch.url: http://{{ ELASTIC_SEARCH_URL }} | ||
server.basePath: "{{ BASE_PATH }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
repository: monasca/aggregator | ||
variants: | ||
- tag: 0.1.1 | ||
- tag: 0.1.2 | ||
aliases: | ||
- :latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.