8000 feat: expose app insights as Prometheus metrics by mtojek · Pull Request #10346 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: expose app insights as Prometheus metrics #10346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Nov 7, 2023
Prev Previous commit
Next Next commit
comment
  • Loading branch information
mtojek committed Nov 7, 2023
commit 16eedee0a74a4f2063bd97f31d074b699f078885
6 changes: 5 additions & 1 deletion coderd/prometheusmetrics/insights/metricscollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ func (mc *MetricsCollector) Collect(metricsCh chan<- prometheus.Metric) {

// Custom apps
for _, appRow := range data.apps {
metricsCh <- prometheus.MustNewConstMetric(applicationsUsageSecondsDesc, prometheus.GaugeValue, float64(appRow.UsageSeconds), appRow.DisplayName.String, data.templateNames[appRow.TemplateID])
displayName := appRow.DisplayName.String
if displayName == "" { // just in case Prometheus complains about missing label value
displayName = "unknown"
}
metricsCh <- prometheus.MustNewConstMetric(applicationsUsageSecondsDesc, prometheus.GaugeValue, float64(appRow.UsageSeconds), displayName, data.templateNames[appRow.TemplateID])
}

// Built-in apps
Expand Down
0