opencensus-stackdriver 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 04e6a40b57873eb8c4ddc3194c408a08ae507702
4
- data.tar.gz: 16d40fb878966e05962eb6c28e73f6c7f4c67bbd
2
+ SHA256:
3
+ metadata.gz: 6648ab08a2f19dcc8378487f54025f43d3f0fbbf5144582a095eb1df50d899a8
4
+ data.tar.gz: b35b154b195811a9fc6a69cbdf553825f59818390a8e80dbbd9d7138767c8934
5
5
  SHA512:
6
- metadata.gz: 26f45ab39ac8331d68ac9c38daafe415299b4b96039b292d794fba4c0cde1bd2a706cacbc3674ff690ee225ff02f9ac5d9b3bc451d7e7aac27d6fa24fb61b59a
7
- data.tar.gz: c4d5422cb3f0972820a5b671a42786f5af116d86c250bd0e42aa6d3a7b676198c6e30f622f52e1cf2982ebd9aee66c8d681ba835296d96059622ba800b3a75f0
6
+ metadata.gz: 59d6285c74a85ed961450af1a9d847c436aecd190ad7afae0c76206e0eb33fb7d30eecaa382ab8039a668d8f232a574c5bad65a6b24641d399a57b5fd973db16
7
+ data.tar.gz: 4559660ff5249c3535b42f4e813c1b93adf026d07c152d855d3c86cd18768fb5d6bd6a6d3430807cc89dbd63c3eb129b4ac949524ee43ca86e3f760bf5b2b0f0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release History
2
2
 
3
+ ### 0.1.2 / 2018-05-22
4
+
5
+ * Add agent identifier and version attribute to reported spans.
6
+
3
7
  ### 0.1.1 / 2018-04-13
4
8
 
5
9
  * Clean unneeded files from the gem
@@ -15,6 +15,6 @@
15
15
  module OpenCensus
16
16
  module Stackdriver
17
17
  ## Current OpenCensus Stackdriver plugin version
18
- VERSION = "0.1.1".freeze
18
+ VERSION = "0.1.2".freeze
19
19
  end
20
20
  end
@@ -37,6 +37,21 @@ module OpenCensus
37
37
  #
38
38
  TraceProtos = Google::Devtools::Cloudtrace::V2
39
39
 
40
+ ##
41
+ # @private
42
+ # Attribute key for Stackdriver trace agent
43
+ #
44
+ AGENT_KEY = "g.co/agent".freeze
45
+
46
+ ##
47
+ # @private
48
+ # Attribute value for Stackdriver trace agent
49
+ #
50
+ AGENT_VALUE =
51
+ OpenCensus::Trace::TruncatableString.new \
52
+ "opencensus-ruby [#{::OpenCensus::VERSION}] ruby-stackdriver-" \
53
+ "exporter [#{::OpenCensus::Stackdriver::VERSION}]"
54
+
40
55
  ##
41
56
  # Create a converter
42
57
  #
@@ -66,7 +81,8 @@ module OpenCensus
66
81
  end_time: convert_time(obj.end_time),
67
82
  attributes:
68
83
  convert_attributes(obj.attributes,
69
- obj.dropped_attributes_count),
84
+ obj.dropped_attributes_count,
85
+ include_agent_attribute: true),
70
86
  stack_trace:
71
87
  convert_stack_trace(obj.stack_trace, obj.dropped_frames_count,
72
88
  obj.stack_trace_hash_id),
@@ -159,11 +175,17 @@ module OpenCensus
159
175
  #
160
176
  # @param [Hash] attributes The map of attribute values to convert
161
177
  # @param [Integer] dropped_attributes_count Number of dropped
178
+ # @param [Boolean] include_agent_attribute Include the `g.co/agent`
179
+ # attribute in the result. Default is false.
162
180
  # @return [Google::Devtools::Cloudtrace::V2::Attributes] The
163
181
  # generated proto
164
182
  #
165
- def convert_attributes attributes, dropped_attributes_count
183
+ def convert_attributes attributes, dropped_attributes_count,
184
+ include_agent_attribute: false
166
185
  attribute_map = {}
186
+ if include_agent_attribute
187
+ attribute_map[AGENT_KEY] = convert_attribute_value AGENT_VALUE
188
+ end
167
189
  attributes.each do |k, v|
168
190
  attribute_map[k] = convert_attribute_value v
169
191
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opencensus-stackdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-13 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
217
  version: '0'
218
218
  requirements: []
219
219
  rubyforge_project:
220
- rubygems_version: 2.6.14
220
+ rubygems_version: 2.7.6
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: Stackdriver exporter for OpenCensus