Skip to content

Commit b2277dd

Browse files
committed
fix test and bootstrap_gen
Signed-off-by: emdneto <[email protected]>
1 parent 77ec695 commit b2277dd

File tree

2 files changed

+13
-20
lines changed
  • instrumentation/opentelemetry-instrumentation-falcon/tests
  • opentelemetry-instrumentation/src/opentelemetry/instrumentation

2 files changed

+13
-20
lines changed

instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def _test_method(self, method):
133133
SpanAttributes.HTTP_SCHEME: "http",
134134
SpanAttributes.NET_HOST_PORT: 80,
135135
SpanAttributes.HTTP_HOST: "falconframework.org",
136+
SpanAttributes.HTTP_TARGET: "/"
137+
if self._has_fixed_http_target
138+
else "/hello",
136139
SpanAttributes.NET_PEER_PORT: 65133,
137140
SpanAttributes.HTTP_FLAVOR: "1.1",
138141
"falcon.resource": "HelloWorldResource",
@@ -146,11 +149,6 @@ def _test_method(self, method):
146149
self.assertEqual(
147150
span.attributes[SpanAttributes.NET_PEER_IP], "127.0.0.1"
148151
)
149-
self.assertEqual(
150-
span.attributes[SpanAttributes.HTTP_TARGET],
151-
"/" if self._has_fixed_http_target else "/hello",
152-
)
153-
154152
self.memory_exporter.clear()
155153

156154
def test_404(self):
@@ -168,6 +166,9 @@ def test_404(self):
168166
SpanAttributes.HTTP_SCHEME: "http",
169167
SpanAttributes.NET_HOST_PORT: 80,
170168
SpanAttributes.HTTP_HOST: "falconframework.org",
169+
SpanAttributes.HTTP_TARGET: "/"
170+
if self._has_fixed_http_target
171+
else "/does-not-exist",
171172
SpanAttributes.NET_PEER_PORT: 65133,
172173
SpanAttributes.HTTP_FLAVOR: "1.1",
173174
SpanAttributes.HTTP_STATUS_CODE: 404,
@@ -180,10 +181,6 @@ def test_404(self):
180181
self.assertEqual(
181182
span.attributes[SpanAttributes.NET_PEER_IP], "127.0.0.1"
182183
)
183-
self.assertEqual(
184-
span.attributes[SpanAttributes.HTTP_TARGET],
185-
"/" if self._has_fixed_http_target else "/does-not-exist",
186-
)
187184

188185
def test_500(self):
189186
try:
@@ -208,6 +205,9 @@ def test_500(self):
208205
SpanAttributes.HTTP_SCHEME: "http",
209206
SpanAttributes.NET_HOST_PORT: 80,
210207
SpanAttributes.HTTP_HOST: "falconframework.org",
208+
SpanAttributes.HTTP_TARGET: "/"
209+
if self._has_fixed_http_target
210+
else "/error",
211211
SpanAttributes.NET_PEER_PORT: 65133,
212212
SpanAttributes.HTTP_FLAVOR: "1.1",
213213
SpanAttributes.HTTP_STATUS_CODE: 500,
@@ -221,11 +221,6 @@ def test_500(self):
221221
span.attributes[SpanAttributes.NET_PEER_IP], "127.0.0.1"
222222
)
223223

224-
self.assertEqual(
225-
span.attributes[SpanAttributes.HTTP_TARGET],
226-
"/" if self._has_fixed_http_target else "/error",
227-
)
228-
229224
def test_url_template(self):
230225
self.client().simulate_get("/user/123")
231226
spans = self.memory_exporter.get_finished_spans()
@@ -245,18 +240,16 @@ def test_url_template(self):
245240
SpanAttributes.HTTP_SCHEME: "http",
246241
SpanAttributes.NET_HOST_PORT: 80,
247242
SpanAttributes.HTTP_HOST: "falconframework.org",
243+
SpanAttributes.HTTP_TARGET: "/"
244+
if self._has_fixed_http_target
245+
else "/user/123",
248246
SpanAttributes.NET_PEER_PORT: 65133,
249247
SpanAttributes.HTTP_FLAVOR: "1.1",
250248
"falcon.resource": "UserResource",
251249
SpanAttributes.HTTP_STATUS_CODE: 200,
252250
},
253251
)
254252

255-
self.assertEqual(
256-
span.attributes[SpanAttributes.HTTP_TARGET],
257-
"/" if self._has_fixed_http_target else "/user/123",
258-
)
259-
260253
def test_uninstrument(self):
261254
self.client().simulate_get(path="/hello")
262255
spans = self.memory_exporter.get_finished_spans()

opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
},
9595
{
9696
"library": "falcon >= 1.4.1, < 5.0.0",
97-
"instrumentation": "opentelemetry-instrumentation-falcon==0.50b0.dev",
97+
"instrumentation": "opentelemetry-instrumentation-falcon==0.51b0.dev",
9898
},
9999
{
100100
"library": "fastapi ~= 0.58",

0 commit comments

Comments
 (0)