Skip to content

Commit

Permalink
refactor(fetcher): update log level for PromQL API result and adjust …
Browse files Browse the repository at this point in the history
…REST API query log message
  • Loading branch information
silvestre committed Nov 20, 2024
1 parent e2567a5 commit 6dd8a6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/autoscaler/eventgenerator/metric/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (l *logCacheFetcher) getMetricsPromQLAPI(appId string, metricType string, c
if err != nil {
return []models.AppInstanceMetric{}, fmt.Errorf("failed getting PromQL result (metricType: %s, appId: %s, collectionInterval: %s, query: %s, time: %s): %w", metricType, appId, collectionIntervalSeconds, query, now.String(), err)
}
l.logger.Debug("received-promql-api-result", lager.Data{"result": result, "query": query})
l.logger.Info("received-promql-api-result", lager.Data{"result": result, "query": query})

// safeguard: the query ensures that we get a vector but let's double-check
vector := result.GetVector()
Expand Down Expand Up @@ -149,7 +149,7 @@ func (l *logCacheFetcher) emptyAppInstanceMetrics(appId string, name string, uni
func (l *logCacheFetcher) getMetricsRestAPI(appId string, metricType string, startTime time.Time, endTime time.Time) ([]models.AppInstanceMetric, error) {
filters := l.readOptions(endTime, metricType)

l.logger.Info("querying-rest-api-with-filters", lager.Data{"appId": appId, "metricType": metricType, "startTime": startTime, "endTime": endTime, "filters": l.valuesFrom(filters)})
l.logger.Info("query-rest-api-with-filters", lager.Data{"appId": appId, "metricType": metricType, "startTime": startTime, "endTime": endTime, "filters": l.valuesFrom(filters)})
envelopes, err := l.logCacheClient.Read(context.Background(), appId, startTime, filters...)
if err != nil {
return []models.AppInstanceMetric{}, fmt.Errorf("fail to Read %s metric from %s GoLogCache client: %w", logcache_v1.EnvelopeType_GAUGE, appId, err)
Expand Down

0 comments on commit 6dd8a6b

Please sign in to comment.