Skip to content

Commit

Permalink
chore(debug): Add log.debug statements to StackdriverMetricsService. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler committed Jan 23, 2018
1 parent 8c82875 commit 7815442
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ public List<MetricSet> queryMetrics(String metricsAccountName,
filter += " AND " + customFilter;
}

log.debug("filter={}", filter);

long alignmentPeriodSec = stackdriverCanaryScope.getStep();
Monitoring.Projects.TimeSeries.List list = monitoring
.projects()
Expand Down Expand Up @@ -268,6 +270,9 @@ String expandCustomFilter(CanaryConfig canaryConfig,
String customFilter = stackdriverMetricSetQuery.getCustomFilter();
String customFilterTemplate = stackdriverMetricSetQuery.getCustomFilterTemplate();

log.debug("customFilter={}", customFilter);
log.debug("customFilterTemplate={}", customFilterTemplate);

if (StringUtils.isEmpty(customFilter) && !StringUtils.isEmpty(customFilterTemplate)) {
Map<String, String> templates = canaryConfig.getTemplates();

Expand All @@ -284,12 +289,16 @@ String expandCustomFilter(CanaryConfig canaryConfig,
Template template = new Template(customFilterTemplate, new StringReader(templateStr), configuration);

try {
log.debug("Expanded: extendedScopeParams={}", stackdriverCanaryScope.getExtendedScopeParams());

customFilter = FreeMarkerTemplateUtils.processTemplateIntoString(template, stackdriverCanaryScope.getExtendedScopeParams());
} catch (TemplateException e) {
throw new IllegalArgumentException("Problem evaluating custom filter template:", e);
}
}

log.debug("Expanded: customFilter={}", customFilter);

return customFilter;
}
}

0 comments on commit 7815442

Please sign in to comment.