epsagon 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/epsagon.rb +2 -0
- data/lib/instrumentation/aws_sdk.rb +1 -26
- data/lib/instrumentation/aws_sdk_plugin.rb +26 -0
- 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: dcd34d0e419fb2fcbc2ffa3d2b7a90c5d7ca801934050d2a1dbce6c6060cdd1b
|
4
|
+
data.tar.gz: 0fdb70755b5db1bd8fc965fd47d1f8d8d0ac28d8e131ab7f768311d33c44ae71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b868ea0d2887c31e1781ebbe31c6a5f04fb2fdafa1ecfc897142555f2191b8f9b606d50a249a025fd141c8e606c521c0030e5f33de139825066fb925dce19619
|
7
|
+
data.tar.gz: 7c376ffa54f29a2186a0b9acf456250738d9d7ea8d1f6a26d673d40118d0210999c500ac58a326593cc32429461bae7e15b98a9856b8dd1cc6675490c9e04a25
|
data/lib/epsagon.rb
CHANGED
@@ -9,6 +9,7 @@ require 'opentelemetry/exporter/otlp'
|
|
9
9
|
require_relative 'instrumentation/sinatra'
|
10
10
|
require_relative 'instrumentation/net_http'
|
11
11
|
require_relative 'instrumentation/faraday'
|
12
|
+
require_relative 'instrumentation/aws_sdk'
|
12
13
|
require_relative 'util'
|
13
14
|
|
14
15
|
Bundler.require
|
@@ -39,6 +40,7 @@ module Epsagon
|
|
39
40
|
configurator.use 'EpsagonSinatraInstrumentation', { epsagon: @@epsagon_config }
|
40
41
|
configurator.use 'EpsagonNetHTTPInstrumentation', { epsagon: @@epsagon_config }
|
41
42
|
configurator.use 'EpsagonFaradayInstrumentation', { epsagon: @@epsagon_config }
|
43
|
+
configurator.use 'EpsagonAwsSdkInstrumentation', { epsagon: @@epsagon_config }
|
42
44
|
|
43
45
|
if @@epsagon_config[:debug]
|
44
46
|
configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
|
@@ -2,32 +2,6 @@
|
|
2
2
|
|
3
3
|
require_relative '../util'
|
4
4
|
|
5
|
-
# AWS SDK plugin for epsagon instrumentation
|
6
|
-
class EpsagonAwsPlugin < Seahorse::Client::Plugin
|
7
|
-
def add_handlers(handlers, _)
|
8
|
-
handlers.add(EpsagonAwsHandler, step: :validate)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
# Generates Spans for all uses of AWS SDK
|
13
|
-
class EpsagonAwsHandler < Seahorse::Client::Handler
|
14
|
-
def call(context)
|
15
|
-
tracer.in_span('') do |span|
|
16
|
-
@handler.call(context).tap do
|
17
|
-
span.set_attribute('aws.operation', context[:command])
|
18
|
-
span.set_attribute('aws.status_code', context[:status_code])
|
19
|
-
span.set_attribute('aws.service', context[:service_name])
|
20
|
-
span.set_attribute('aws.account_id', context[:account_id])
|
21
|
-
span.set_attribute('aws.status_code', context[:status_code])
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def tracer
|
27
|
-
EpsagonAwsSdkInstrumentation.instance.tracer
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
5
|
# AWS SDK epsagon instrumentation
|
32
6
|
class EpsagonAwsSdkInstrumentation < OpenTelemetry::Instrumentation::Base
|
33
7
|
VERSION = '0.0.0'
|
@@ -143,6 +117,7 @@ class EpsagonAwsSdkInstrumentation < OpenTelemetry::Instrumentation::Base
|
|
143
117
|
].freeze
|
144
118
|
|
145
119
|
install do |_|
|
120
|
+
require_relative 'aws_sdk_plugin'
|
146
121
|
::Seahorse::Client::Base.add_plugin(EpsagonAwsPlugin)
|
147
122
|
loaded_constants.each { |klass| klass.add_plugin(EpsagonAwsPlugin) }
|
148
123
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'aws-sdk-core'
|
2
|
+
|
3
|
+
# AWS SDK plugin for epsagon instrumentation
|
4
|
+
class EpsagonAwsPlugin < Seahorse::Client::Plugin
|
5
|
+
def add_handlers(handlers, _)
|
6
|
+
handlers.add(EpsagonAwsHandler, step: :validate)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
# Generates Spans for all uses of AWS SDK
|
11
|
+
class EpsagonAwsHandler < Seahorse::Client::Handler
|
12
|
+
def call(context)
|
13
|
+
tracer.in_span('') do |span|
|
14
|
+
@handler.call(context).tap do
|
15
|
+
span.set_attribute('aws.service', context.client.class.to_s.split('::')[1].downcase)
|
16
|
+
span.set_attribute('aws.aws.operation', context.operation.name)
|
17
|
+
span.set_attribute('aws.region', context.client.config.region)
|
18
|
+
span.set_attribute('aws.status_code', context.http_response.status_code)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def tracer
|
24
|
+
EpsagonAwsSdkInstrumentation.instance.tracer
|
25
|
+
end
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Epsagon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -78,6 +78,7 @@ extra_rdoc_files: []
|
|
78
78
|
files:
|
79
79
|
- lib/epsagon.rb
|
80
80
|
- lib/instrumentation/aws_sdk.rb
|
81
|
+
- lib/instrumentation/aws_sdk_plugin.rb
|
81
82
|
- lib/instrumentation/epsagon_faraday_middleware.rb
|
82
83
|
- lib/instrumentation/faraday.rb
|
83
84
|
- lib/instrumentation/net_http.rb
|