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 +4 -4
- data/README.md +6 -5
- data/Rakefile +8 -0
- data/lib/signalfx/tracing.rb +1 -0
- data/lib/signalfx/tracing/tags.rb +47 -0
- data/lib/signalfx/tracing/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ac0a01141d6701e7d3017525cdcc710ec1b2115a19f671d61ed10f06766a09
|
4
|
+
data.tar.gz: 839316022dd7d73149f8e2d31b95761872e58e8ea2e158de5784cd708990fbab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
120
|
-
| ingest_url | SIGNALFX_ENDPOINT_URL
|
121
|
-
| service_name | SIGNALFX_SERVICE_NAME
|
122
|
-
| access_token | SIGNALFX_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
data/lib/signalfx/tracing.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|