epsagon 0.0.10 → 0.0.11

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: dcd34d0e419fb2fcbc2ffa3d2b7a90c5d7ca801934050d2a1dbce6c6060cdd1b
4
- data.tar.gz: 0fdb70755b5db1bd8fc965fd47d1f8d8d0ac28d8e131ab7f768311d33c44ae71
3
+ metadata.gz: ab0dc77590ae9d619fa9dc901ce8af447cfa4555b3e4e2de648952add1604043
4
+ data.tar.gz: ba0e5a0589ac967734b3019e229031a345577cc44518d876228238011f3bd2a4
5
5
  SHA512:
6
- metadata.gz: b868ea0d2887c31e1781ebbe31c6a5f04fb2fdafa1ecfc897142555f2191b8f9b606d50a249a025fd141c8e606c521c0030e5f33de139825066fb925dce19619
7
- data.tar.gz: 7c376ffa54f29a2186a0b9acf456250738d9d7ea8d1f6a26d673d40118d0210999c500ac58a326593cc32429461bae7e15b98a9856b8dd1cc6675490c9e04a25
6
+ metadata.gz: d383f183f674c601ef695e5b47adcaa770e8d9d6cfbe22d922b4e8785dc2b6f5c677ec0abfaab7c01df880afabe8b3c0395ffc076ff67fe3393ecc06f8a37cd5
7
+ data.tar.gz: 895b8b35143b0c232e4e3611ddf32652163a191f4d58af3283101af3f2f107f396be765931c3734f5f3aebe6cf2ec4f2d19d561b4cc033286cc1a33b4f373fd2
@@ -1,5 +1,10 @@
1
1
  require 'aws-sdk-core'
2
+ require 'opentelemetry/common'
3
+ require 'opentelemetry/sdk'
2
4
 
5
+ def untraced
6
+ OpenTelemetry::Trace.with_span(OpenTelemetry::Trace::Span.new) { yield }
7
+ end
3
8
  # AWS SDK plugin for epsagon instrumentation
4
9
  class EpsagonAwsPlugin < Seahorse::Client::Plugin
5
10
  def add_handlers(handlers, _)
@@ -11,11 +16,13 @@ end
11
16
  class EpsagonAwsHandler < Seahorse::Client::Handler
12
17
  def call(context)
13
18
  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
+ untraced do
20
+ @handler.call(context).tap do
21
+ span.set_attribute('aws.service', context.client.class.to_s.split('::')[1].downcase)
22
+ span.set_attribute('aws.aws.operation', context.operation.name)
23
+ span.set_attribute('aws.region', context.client.config.region)
24
+ span.set_attribute('aws.status_code', context.http_response.status_code)
25
+ end
19
26
  end
20
27
  end
21
28
  end
@@ -48,7 +48,7 @@ class EpsagonTracerMiddleware
48
48
  tracer.in_span(
49
49
  env['HTTP_HOST'],
50
50
  attributes: attributes,
51
- kind: :Server,
51
+ kind: :server,
52
52
  with_parent: parent_context(env)
53
53
  ) do |http_span|
54
54
  tracer.in_span('sinatra') do |framework_span|
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.10
4
+ version: 0.0.11
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 00:00:00.000000000 Z
11
+ date: 2021-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api