Skip to content

Commit 8390d6a

Browse files
author
Lucas Thomas
committed
SF-2912: Added ClientDeviceID to metrics
1 parent 4d76d7e commit 8390d6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/stackify/metrics/metrics_sender.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ def monitor_info aggr_metric
1414
def upload_metrics aggr_metrics
1515
return true if aggr_metrics.nil? || aggr_metrics.length == 0
1616
current_time = Stackify::Utils.rounded_current_time
17+
device_id = Stackify::EnvDetails.instance.auth_info['DeviceID']
1718
if Stackify.authorized?
1819
records = []
1920
aggr_metrics.each_pair do |_key, metric|
2021
next if metric.sent || metric.occurred_utc.to_i >= current_time.to_i
21-
records << Stackify::Metrics::MetricForSubmit.new(metric).to_h
22+
record = Stackify::Metrics::MetricForSubmit.new(metric).to_h
23+
record['ClientDeviceID'] = device_id if !device_id.nil?
24+
records << record
2225
metric.sent = true
2326
end
2427
if records.any?

0 commit comments

Comments
 (0)