signalfx-tracing 1.3.3 → 1.4.0

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
2
  SHA256:
3
- metadata.gz: e8255be0adcf8bd4fe4412bfed79136715ec13962fa187d08e6e199bba5b3311
4
- data.tar.gz: 93708387b7486bd4995b0b509f0ba02cb9fa544f963666b5f2d56eb489395735
3
+ metadata.gz: a3ac0a01141d6701e7d3017525cdcc710ec1b2115a19f671d61ed10f06766a09
4
+ data.tar.gz: 839316022dd7d73149f8e2d31b95761872e58e8ea2e158de5784cd708990fbab
5
5
  SHA512:
6
- metadata.gz: 1b1a21c3a139f0accc57cebd68c736112eeae7b9c6c4d63cbad374969f677c8901026ec06acec13d458c34dccb04d541528b395f2f2adb8c2715f5d67187d05f
7
- data.tar.gz: 61fbd5998c46d0c44551308598da14a92e8a7f1d08a00715ee8ca1e4bfd508c1bd4fad991fe76fa5913e857fab28eed35fa593404524c2b6a15f9f7105892f79
6
+ metadata.gz: b8408b6e53193f91c41a76d115c3695f3bce83e917362804cd987b60cbeb5d66aa592f6709f842e8aaf874c2070443e8fc33340723f13093df7e35c997b74bf1
7
+ data.tar.gz: a2e6b995a3d30c97b786a3d923bca036175cd2458f0a66dfe5bc1ced94b13488660948b024e492f50320ca88cfd467acf0acd10807976bf6cda8bc437d7a7b34
data/README.md CHANGED
@@ -115,11 +115,12 @@ instrumentation is convenient when you want to trace only some libraries.
115
115
  If the default configuration values don't apply for your environment, override them before running the process you instrument.
116
116
 
117
117
  | `configure` parameter | Environment variable | Default | Notes |
118
- | ------------------- | -------------------- | -------------------------------- | ----- |
119
- | tracer | N/A | `nil` | The OpenTracing global tracer. |
120
- | ingest_url | SIGNALFX_ENDPOINT_URL | `http://localhost:9080/v1/trace` | The endpoint the tracer sends spans to. Send spans to a Smart Agent, OpenTelemetry Collector, or a SignalFx ingest endpoint. |
121
- | service_name | SIGNALFX_SERVICE_NAME | `signalfx-ruby-tracing` | The name to identify the service in SignalFx. |
122
- | access_token | SIGNALFX_ACCESS_TOKEN | `''` | The SignalFx organization access token. |
118
+ | ------------------- | --------------------------------- | -------------------------------- | ----- |
119
+ | tracer | N/A | `nil` | The OpenTracing global tracer. |
120
+ | ingest_url | SIGNALFX_ENDPOINT_URL | `http://localhost:9080/v1/trace` | The endpoint the tracer sends spans to. Send spans to a Smart Agent, OpenTelemetry Collector, or a SignalFx ingest endpoint. |
121
+ | service_name | SIGNALFX_SERVICE_NAME | `signalfx-ruby-tracing` | The name to identify the service in SignalFx. |
122
+ | access_token | SIGNALFX_ACCESS_TOKEN | `''` | The SignalFx organization access token. |
123
+ | N/A | SIGNALFX_RECORDED_VALUE_MAX_LENGTH | `1200` | Maximum length an attribute value can have. Values longer than this are truncated. |
123
124
 
124
125
  ### Automatically instrument code:
125
126
 
data/Rakefile CHANGED
@@ -1,2 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
+ require 'rake/testtask'
3
+
2
4
  task :default => :spec
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.libs << "test"
8
+ t.test_files = FileList['test/*test.rb']
9
+ t.verbose = false
10
+ end
@@ -3,6 +3,7 @@ require 'signalfx/tracing/http_sender'
3
3
  require 'signalfx/tracing/register'
4
4
  require 'signalfx/tracing/compat'
5
5
  require 'signalfx/tracing/sfx_logger'
6
+ require 'signalfx/tracing/tags'
6
7
  require 'thread'
7
8
 
8
9
  module SignalFx
@@ -0,0 +1,47 @@
1
+ require 'jaeger/span'
2
+
3
+ module SignalFx
4
+ module Tracing
5
+ module TagBuilder
6
+ def self.prepended(base)
7
+ base.singleton_class.prepend(ClassMethods)
8
+ end
9
+
10
+ module ClassMethods
11
+ @@max_attr_length = (ENV['SIGNALFX_RECORDED_VALUE_MAX_LENGTH'] || '1200').to_i
12
+
13
+ def self.max_attr_length
14
+ @@max_attr_length
15
+ end
16
+
17
+ def self.max_attr_length=(v)
18
+ @@max_attr_length = v
19
+ end
20
+
21
+ def _truncate_value_if_needed(value)
22
+ if value.is_a? String
23
+ if @@max_attr_length > 0
24
+ value = value[0..@@max_attr_length-1]
25
+ end
26
+ end
27
+ return value
28
+ end
29
+
30
+ def build(key, value)
31
+ tag = super(key, value)
32
+ if tag.vStr != nil
33
+ tag.vStr = _truncate_value_if_needed(tag.vStr)
34
+ end
35
+ tag
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+
43
+ module Jaeger
44
+ class ThriftTagBuilder
45
+ prepend SignalFx::Tracing::TagBuilder
46
+ end
47
+ end
@@ -1,5 +1,5 @@
1
1
  module Signalfx
2
2
  module Tracing
3
- VERSION = "1.3.3"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signalfx-tracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SignalFx, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-24 00:00:00.000000000 Z
11
+ date: 2020-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,6 +118,7 @@ files:
118
118
  - lib/signalfx/tracing/register.rb
119
119
  - lib/signalfx/tracing/reporter/auto_reviving_async_reporter.rb
120
120
  - lib/signalfx/tracing/sfx_logger.rb
121
+ - lib/signalfx/tracing/tags.rb
121
122
  - lib/signalfx/tracing/tracer.rb
122
123
  - lib/signalfx/tracing/version.rb
123
124
  - signalfx-tracing.gemspec