Send stat_tag metric when available
This commit is contained in:
@@ -50,6 +50,7 @@ function getEventData (req, res, tags) {
|
||||
map_id: getLayergroupid({ res }),
|
||||
cache_buster: getCacheBuster({ res }),
|
||||
template_hash: getTemplateHash({ res }),
|
||||
stat_tag: getStatTag({ res }),
|
||||
response_code: res.statusCode.toString(),
|
||||
response_time: getResponseTime(res),
|
||||
source_domain: req.hostname,
|
||||
@@ -98,6 +99,17 @@ function getTemplateHash ({ res }) {
|
||||
return res.locals.templateHash;
|
||||
}
|
||||
|
||||
function getStatTag ({ res }) {
|
||||
if (res.locals.mapConfig) {
|
||||
return res.locals.mapConfig.obj().stat_tag;
|
||||
}
|
||||
|
||||
// FIXME: don't expect that mapConfig is already set
|
||||
if (res.locals.mapConfigProvider && res.locals.mapConfigProvider.mapConfig) {
|
||||
return res.locals.mapConfigProvider.mapConfig.obj().stat_tag;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: 'X-Tiler-Profiler' might not be accurate enough
|
||||
function getResponseTime (res) {
|
||||
const profiler = res.get('X-Tiler-Profiler');
|
||||
|
||||
Reference in New Issue
Block a user