epsagon 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epsagon.rb +23 -21
- data/lib/instrumentation/net_http.rb +1 -1
- metadata +14 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb98b789dd4555d9f05f499d54eeeb40910d00e197d957e954ebf0390215955c
|
4
|
+
data.tar.gz: 0d17be938d96aa2b24a45b895fd1f00d663c193ffd9d43da4700ea048692d6a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62f724706b2b36cb7fdcdf3afa14d3b3103d394ef09daace93307e58241578c459c2b8c6c71493ff00b75c1136dce861148dad4e2c36030c861c0e9a52230aa2
|
7
|
+
data.tar.gz: b744cbda8a2636f934ee7b51c0eb2547fd0bbc39c17a222a898e3f874310d398977105fc447830343791019f6d5a0292a3ff2f0598450de4f93d3ff08953f908
|
data/lib/epsagon.rb
CHANGED
@@ -14,52 +14,54 @@ Bundler.require
|
|
14
14
|
|
15
15
|
# Epsagon tracing main entry point
|
16
16
|
module Epsagon
|
17
|
-
|
18
|
-
|
19
|
-
def init(**args)
|
20
|
-
defaults = {
|
17
|
+
@@epsagon_config = {
|
21
18
|
metadata_only: ENV['EPSAGON_METADATA']&.to_s&.downcase != 'false',
|
22
19
|
debug: ENV['EPSAGON_DEBUG']&.to_s&.downcase == 'true',
|
23
20
|
token: ENV['EPSAGON_TOKEN'],
|
24
21
|
app_name: ENV['EPSAGON_APP_NAME'],
|
25
22
|
backend: ENV['EPSAGON_BACKEND'] || 'localhost:55681/v1/trace'
|
26
23
|
}
|
27
|
-
@@epsagon_config = defaults.merge(args)
|
28
|
-
end
|
29
24
|
|
30
|
-
|
31
|
-
ENV['EPSAGON_METADATA']&.to_s&.downcase != 'false'
|
32
|
-
end
|
25
|
+
module_function
|
33
26
|
|
34
|
-
def
|
35
|
-
|
27
|
+
def init(**args)
|
28
|
+
@@epsagon_config.merge!(args)
|
29
|
+
OpenTelemetry::SDK.configure
|
36
30
|
end
|
37
31
|
|
38
32
|
# config opentelemetry with epsaon extensions:
|
39
33
|
|
40
34
|
def epsagon_confs(configurator)
|
41
35
|
configurator.resource = OpenTelemetry::SDK::Resources::Resource.telemetry_sdk.merge(
|
42
|
-
OpenTelemetry::SDK::Resources::Resource.create({ 'application' =>
|
36
|
+
OpenTelemetry::SDK::Resources::Resource.create({ 'application' => @@epsagon_config[:app_name] })
|
43
37
|
)
|
44
38
|
configurator.use 'EpsagonSinatraInstrumentation', { epsagon: @@epsagon_config }
|
45
39
|
configurator.use 'EpsagonNetHTTPInstrumentation', { epsagon: @@epsagon_config }
|
46
40
|
configurator.use 'EpsagonFaradayInstrumentation', { epsagon: @@epsagon_config }
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
|
42
|
+
if @@epsagon_config[:debug]
|
43
|
+
configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
|
44
|
+
OpenTelemetry::Exporter::OTLP::Exporter.new(headers: {
|
50
45
|
'x-epsagon-token' => @@epsagon_config[:token]
|
51
46
|
},
|
52
47
|
endpoint: @@epsagon_config[:backend],
|
53
48
|
insecure: @@epsagon_config[:insecure] || false)
|
54
|
-
|
55
|
-
return unless debug?
|
49
|
+
)
|
56
50
|
|
57
|
-
|
58
|
-
|
59
|
-
|
51
|
+
configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
|
52
|
+
OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter.new
|
53
|
+
)
|
54
|
+
else
|
55
|
+
configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
|
56
|
+
exporter: OpenTelemetry::Exporter::OTLP::Exporter.new(headers: {
|
57
|
+
'x-epsagon-token' => @@epsagon_config[:token]
|
58
|
+
},
|
59
|
+
endpoint: @@epsagon_config[:backend],
|
60
|
+
insecure: @@epsagon_config[:insecure] || false)
|
61
|
+
)
|
62
|
+
end
|
60
63
|
end
|
61
64
|
|
62
|
-
OpenTelemetry::SDK.configure
|
63
65
|
end
|
64
66
|
|
65
67
|
# monkey patch to include epsagon confs
|
metadata
CHANGED
@@ -1,17 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epsagon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Epsagon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Epsagon for
|
14
|
-
|
13
|
+
description: 'Epsagon provides tracing to Ruby applications for the collection of
|
14
|
+
distributed tracing and performance metrics to simplify complex architectures, eliminate
|
15
|
+
manual work, visualize and correlate data to identify and fix problems fast.
|
16
|
+
|
17
|
+
'
|
18
|
+
email: info@epsagon.com
|
15
19
|
executables: []
|
16
20
|
extensions: []
|
17
21
|
extra_rdoc_files: []
|
@@ -23,7 +27,7 @@ files:
|
|
23
27
|
- lib/instrumentation/net_http.rb
|
24
28
|
- lib/instrumentation/sinatra.rb
|
25
29
|
- lib/util.rb
|
26
|
-
homepage: https://
|
30
|
+
homepage: https://github.com/epsagon/epsagon-ruby
|
27
31
|
licenses:
|
28
32
|
- MIT
|
29
33
|
metadata: {}
|
@@ -33,9 +37,9 @@ require_paths:
|
|
33
37
|
- lib
|
34
38
|
required_ruby_version: !ruby/object:Gem::Requirement
|
35
39
|
requirements:
|
36
|
-
- - "
|
40
|
+
- - ">="
|
37
41
|
- !ruby/object:Gem::Version
|
38
|
-
version:
|
42
|
+
version: 2.0.0
|
39
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
45
|
- - ">="
|
@@ -45,5 +49,6 @@ requirements: []
|
|
45
49
|
rubygems_version: 3.1.4
|
46
50
|
signing_key:
|
47
51
|
specification_version: 4
|
48
|
-
summary: Epsagon for
|
52
|
+
summary: Epsagon provides tracing to Ruby applications for the collection of distributed
|
53
|
+
tracing and performance metrics.
|
49
54
|
test_files: []
|