epsagon 0.0.2 → 0.0.7

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: cb98b789dd4555d9f05f499d54eeeb40910d00e197d957e954ebf0390215955c
4
- data.tar.gz: 0d17be938d96aa2b24a45b895fd1f00d663c193ffd9d43da4700ea048692d6a2
3
+ metadata.gz: bd8b447f6b5d8e9f1dc22ae3b5e11e05b5236e4c84acb54b940e2cbb04d4f2ac
4
+ data.tar.gz: 45822ce4a73671ac392e1f380b10a37b87fcf4ab2f292eb4e3255d289838a188
5
5
  SHA512:
6
- metadata.gz: 62f724706b2b36cb7fdcdf3afa14d3b3103d394ef09daace93307e58241578c459c2b8c6c71493ff00b75c1136dce861148dad4e2c36030c861c0e9a52230aa2
7
- data.tar.gz: b744cbda8a2636f934ee7b51c0eb2547fd0bbc39c17a222a898e3f874310d398977105fc447830343791019f6d5a0292a3ff2f0598450de4f93d3ff08953f908
6
+ metadata.gz: 3c4bcf3d0d267bc843610351b8eb5788e5e99613fbc7f40b36acfdada628c73d5b3f524b69b5ceaa0fda047abbc9e0bc18bdccd0edfe59f3aa2b52f8650e9fc8
7
+ data.tar.gz: e4440cffd10b7a003dbbeac40b3521a8f9465ef0a3bc3d30df2e87c62d02067c09863e1bf0f49129172cd1a3f5291c83a489bdc91d79a6f6f9a8cd3a96a64574
data/lib/epsagon.rb CHANGED
@@ -3,7 +3,8 @@
3
3
  require 'rubygems'
4
4
  require 'net/http'
5
5
  require 'bundler/setup'
6
- require 'opentelemetry'
6
+ require 'opentelemetry/sdk'
7
+ require 'opentelemetry/exporter/otlp'
7
8
 
8
9
  require_relative 'instrumentation/sinatra'
9
10
  require_relative 'instrumentation/net_http'
@@ -41,11 +42,11 @@ module Epsagon
41
42
 
42
43
  if @@epsagon_config[:debug]
43
44
  configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
44
- OpenTelemetry::Exporter::OTLP::Exporter.new(headers: {
45
- 'x-epsagon-token' => @@epsagon_config[:token]
46
- },
47
- endpoint: @@epsagon_config[:backend],
48
- insecure: @@epsagon_config[:insecure] || false)
45
+ OpenTelemetry::Exporter::OTLP::Exporter.new(headers: {
46
+ 'x-epsagon-token' => @@epsagon_config[:token]
47
+ },
48
+ endpoint: @@epsagon_config[:backend],
49
+ insecure: @@epsagon_config[:insecure] || false)
49
50
  )
50
51
 
51
52
  configurator.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
@@ -12,10 +12,12 @@ end
12
12
  # Generates Spans for all uses of AWS SDK
13
13
  class EpsagonAwsHandler < Seahorse::Client::Handler
14
14
  def call(context)
15
- span_name = "AWS #{context[:service_name]}"
16
- tracer.in_span(span_name) do |span|
15
+ tracer.in_span('') do |span|
17
16
  @handler.call(context).tap do
18
- span.set_attribute('aws.command', context[:command])
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])
19
21
  span.set_attribute('aws.status_code', context[:status_code])
20
22
  end
21
23
  end
metadata CHANGED
@@ -1,15 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epsagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.7
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-01 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: opentelemetry-api
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.11.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: opentelemetry-sdk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.11.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.11.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: sinatra
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: opentelemetry-instrumentation-sinatra
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.11.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.11.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: opentelemetry-exporter-otlp
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.11.0
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.11.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: faraday
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.3'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.3'
13
97
  description: 'Epsagon provides tracing to Ruby applications for the collection of
14
98
  distributed tracing and performance metrics to simplify complex architectures, eliminate
15
99
  manual work, visualize and correlate data to identify and fix problems fast.
@@ -21,7 +105,6 @@ extensions: []
21
105
  extra_rdoc_files: []
22
106
  files:
23
107
  - lib/epsagon.rb
24
- - lib/epsagon_opentelemetry.rb
25
108
  - lib/instrumentation/aws_sdk.rb
26
109
  - lib/instrumentation/faraday.rb
27
110
  - lib/instrumentation/net_http.rb
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubygems'
4
- require 'net/http'
5
- require 'bundler/setup'
6
- require 'opentelemetry'
7
-
8
- require_relative 'instrumentation/sinatra'
9
- require_relative 'instrumentation/net_http'
10
- require_relative 'instrumentation/faraday'
11
- require_relative 'util'
12
-
13
- Bundler.require
14
-
15
- def metadata_only?
16
- ENV['EPSAGON_METADATA']&.to_s&.downcase != 'false'
17
- end
18
-
19
- def debug?
20
- ENV['EPSAGON_DEBUG']&.to_s&.downcase == 'true'
21
- end
22
-
23
- # #config opentelemetry with epsaon extensions:
24
- OpenTelemetry::SDK.configure do |c|
25
- c.use 'EpsagonSinatraInstrumentation'
26
- c.use 'EpsagonNetHTTPInstrumentation'
27
- c.use 'EpsagonFaradayInstrumentation'
28
- if debug?
29
- c.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
30
- OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter.new
31
- )
32
- else
33
- c.add_span_processor OpenTelemetry::SDK::Trace::Export::SimpleSpanProcessor.new(
34
- EpsagonExporter.new(headers: {
35
- epasgon_token: ENV['EPSAGON_TOKEN'],
36
- epasgon_app_name: ENV['EPSAGON_APP_NAME']
37
- },
38
- endpoint: '7fybd5lgpc.execute-api.us-east-2.amazonaws.com:443/dev/trace',
39
- insecure: false)
40
- )
41
- end
42
- end