epsagon 0.0.30 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/epsagon_constants.rb +1 -1
- data/lib/instrumentation/epsagon_rails_middleware.rb +1 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d478fc58c432f30f98f666ae27e27b31bca3fd88254d0ef5b108b6d52a21d715
|
4
|
+
data.tar.gz: d535f30b5a159895c985ef0da98f1e1ea2c433db3f4163805fb5b3d6c7e1fa82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 021e018a393a88cefb02c31ba2ee66fb5ec5f367b468ab1ed2b6537ba7e951ee3ccad40535ceed66b498589fbc1c5190cfac31f69a439a40afbc99547bbe4506
|
7
|
+
data.tar.gz: 0fc691d485e757bc0314acc6ef5901ea39a676da2725bed92700f2260b6f37e48025c5b25c2f9a0a18f46fb35cd175c11bb2843fabeb1dc960b7dd1367f79e2c
|
data/lib/epsagon_constants.rb
CHANGED
@@ -76,11 +76,9 @@ class EpsagonRackMiddleware
|
|
76
76
|
|
77
77
|
def call(env)
|
78
78
|
original_env = env.dup
|
79
|
-
extracted_context = OpenTelemetry.propagation.http.extract(env)
|
80
|
-
frontend_context = create_frontend_span(env, extracted_context)
|
81
79
|
|
82
80
|
# restore extracted context in this process:
|
83
|
-
OpenTelemetry::Context.with_current(
|
81
|
+
OpenTelemetry::Context.with_current(OpenTelemetry.propagation.http.extract(env)) do
|
84
82
|
request_span_name = create_request_span_name(env['REQUEST_URI'] || original_env['PATH_INFO'])
|
85
83
|
tracer.in_span(env['HTTP_HOST'] || 'unknown',
|
86
84
|
attributes: request_span_attributes(env: env),
|
@@ -98,28 +96,10 @@ class EpsagonRackMiddleware
|
|
98
96
|
end
|
99
97
|
end
|
100
98
|
end
|
101
|
-
ensure
|
102
|
-
finish_span(frontend_context)
|
103
99
|
end
|
104
100
|
|
105
101
|
private
|
106
102
|
|
107
|
-
# return Context with the frontend span as the current span
|
108
|
-
def create_frontend_span(env, extracted_context)
|
109
|
-
request_start_time = QueueTime.get_request_start(env)
|
110
|
-
|
111
|
-
return unless config[:record_frontend_span] && !request_start_time.nil?
|
112
|
-
|
113
|
-
span = tracer.start_span('http_server.proxy',
|
114
|
-
with_parent: extracted_context,
|
115
|
-
attributes: {
|
116
|
-
'start_time' => request_start_time.to_f
|
117
|
-
},
|
118
|
-
kind: :server)
|
119
|
-
|
120
|
-
OpenTelemetry::Trace.context_with_span(span, parent_context: extracted_context)
|
121
|
-
end
|
122
|
-
|
123
103
|
def finish_span(context)
|
124
104
|
OpenTelemetry::Trace.current_span(context).finish if context
|
125
105
|
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.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Epsagon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|