made cluster stats report url configurable

also removed report id as it should be automatically generated to avoid cross-user collisions.
This commit is contained in:
Boaz Leskes 2014-01-05 22:59:56 +01:00
parent 4ecb474990
commit bf4c501c3b
4 changed files with 21 additions and 3 deletions

View file

@ -13,6 +13,10 @@ module.exports = function (grunt) {
dev: '":'+ (grunt.option('es_port') || 9200) +'"',
dist: "(window.location.port !== '' ? ':'+window.location.port : '')"
},
statsReportUrl: {
dev: '"http://" + window.location.hostname + ":'+ (grunt.option('es_port') || 9200) +'/.marvel_cluster_report/report"',
dist: "TODO_INSERT_SYNC"
},
defaultRoute: {
dev: '/dashboard/file/marvel.overview.json',
dist: '/dashboard/elasticsearch/Marvel%20-%20Overview'

View file

@ -10,7 +10,7 @@ define(['settings'],
/** @scratch /configuration/config.js/2
* === Parameters
*/
return new Settings({
var s = new Settings({
/** @scratch /configuration/config.js/5
* ==== elasticsearch
@ -67,4 +67,6 @@ define(['settings'],
'marvel.cluster'
]
});
});
s.stats_report_url = @@stats_report_url;
return s;
});

View file

@ -171,11 +171,15 @@ function (angular, app, _, kbn) {
};
var sendReport = function(data) {
if (!$scope.config.report_url) {
return;
}
var thisReport = new Date().getTime().toString();
// TODO: Replace this URL with the actual data sink
$http.post(
$scope.config.elasticsearch+'/'+$scope.config.kibana_index+'/report/'+thisReport,
$scope.config.stats_report_url,
data
).success(function() {
console.log('reported');

View file

@ -11,6 +11,10 @@ module.exports = function (config) {
{
match: 'default_route',
replacement: '<%= defaultRoute.dev %>',
},
{
match: 'stats_report_url',
replacement: '<%= statsReportUrl.dev %>',
}
]
},
@ -28,6 +32,10 @@ module.exports = function (config) {
{
match: 'default_route',
replacement: '<%= defaultRoute.dist %>',
},
{
match: 'report_url',
replacement: '<%= reportUrl.dist %>',
}
]
},