You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using cloudeye_exporter on FlexibleEngine (huawei cloud distributed by Orange in France).
When I try to retrieve metrics from SYS.OBS namespace, I have empty datapoints. After investigations, I noticed that the datapoints are not available in the interval [now - 5 minutes, now].
Below is a little quick'n dirty patch that I produced to prove my investigation :
diff -bruaN cloudeye-exporter.orig/collector/collector.go cloudeye-exporter/collector/collector.go
--- cloudeye-exporter.orig/collector/collector.go 2020-05-18 19:23:04.253169061 +0200
+++ cloudeye-exporter/collector/collector.go 2020-05-18 19:24:01.780775057 +0200
@@ -160,10 +160,11 @@
func (exporter *BaseHuaweiCloudExporter) Collect(ch chan<- prometheus.Metric) {
periodm, _ := time.ParseDuration("-5m")
+ offsetm, _ := time.ParseDuration("-5m")
now := time.Now()
- from := strconv.FormatInt(int64(now.Add(periodm).UnixNano()/1e6), 10)
- to := strconv.FormatInt(int64(now.UnixNano()/1e6), 10)
+ from := strconv.FormatInt(int64(now.Add(offsetm).Add(periodm).UnixNano()/1e6), 10)
+ to := strconv.FormatInt(int64(now.Add(offsetm).UnixNano()/1e6), 10)
exporter.From = from
exporter.To = to
Without this patch : datapoints are empty.
With this patch, I get metrics.
I will soon provide a Pull Request with a better fix.
The text was updated successfully, but these errors were encountered:
ymettier
pushed a commit
to ymettier/cloudeye-exporter
that referenced
this issue
May 19, 2020
Hello,
I'm using cloudeye_exporter on FlexibleEngine (huawei cloud distributed by Orange in France).
When I try to retrieve metrics from SYS.OBS namespace, I have empty datapoints. After investigations, I noticed that the datapoints are not available in the interval
[now - 5 minutes, now]
.Below is a little quick'n dirty patch that I produced to prove my investigation :
Without this patch : datapoints are empty.
With this patch, I get metrics.
I will soon provide a Pull Request with a better fix.
The text was updated successfully, but these errors were encountered: