Skip to content

Commit 2a3feb2

Browse files
author
Sam Marx
committed
Customer ID is now optional, and will be depreciated in the future
1 parent db70685 commit 2a3feb2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lib/stackdriver.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ module StackDriver
44
POST_URI = "https://custom-gateway.stackdriver.com/v1/custom"
55
DELETE_URI = "https://custom-gateway.stackdriver.com/v1/delete_custom"
66

7-
def self.init customer_id, api_key
8-
@customer_id = customer_id
9-
@api_key = api_key
7+
def self.init *args
8+
if args.count > 1
9+
puts "Customer ID is no longer needed, and will be deprecated"
10+
args.shift
1011
end
12+
@api_key = args[0]
13+
end
1114

1215
def self.send_metric name, value, time, instance=''
1316
msg = build_message name, value, time, instance
@@ -41,7 +44,6 @@ def self.build_message name, value, time, instance=''
4144
data_point = {'name' => name, 'value' => value, 'collected_at' => time}
4245
data_point.merge!('value' => value) unless value.nil?
4346
data_point.merge!('instance' => instance) unless instance.empty?
44-
{'timestamp' => Time.now.to_i, 'customer_id' => @customer_id,
45-
'proto_version' => '1', 'data' => data_point}
47+
{'timestamp' => Time.now.to_i, 'proto_version' => '1', 'data' => data_point}
4648
end
4749
end

0 commit comments

Comments
 (0)