Skip to content

Commit

Permalink
fix(appsec): ddtrace.ext.SpanTypes not an Enum (#3220)
Browse files Browse the repository at this point in the history
Update from #3192 given new code added by #3027.
  • Loading branch information
majorgreys committed Feb 10, 2022
1 parent 545ffc7 commit a8f2fa8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ddtrace/appsec/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def on_span_start(self, span):

def on_span_finish(self, span):
# type: (Span) -> None
if span.span_type != SpanTypes.WEB.value:
if span.span_type != SpanTypes.WEB:
return
span.set_metric("_dd.appsec.enabled", 1.0)
span._set_str_tag("_dd.runtime_family", "python")
Expand Down
6 changes: 3 additions & 3 deletions tests/appsec/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def test_enable(tracer):
tracer._initialize_span_processors(appsec_enabled=True)
with tracer.trace("test", span_type=SpanTypes.WEB.value) as span:
with tracer.trace("test", span_type=SpanTypes.WEB) as span:
span.set_tag("http.url", "http://example.com/.git")
span.set_tag("http.status_code", "404")

Expand Down Expand Up @@ -48,7 +48,7 @@ def test_enable_bad_rules(rule, exc, tracer):
def test_retain_traces(tracer):
tracer._initialize_span_processors(appsec_enabled=True)

with tracer.trace("test", span_type=SpanTypes.WEB.value) as span:
with tracer.trace("test", span_type=SpanTypes.WEB) as span:
span.set_tag("http.url", "http://example.com/.git")
span.set_tag("http.status_code", "404")

Expand All @@ -58,7 +58,7 @@ def test_retain_traces(tracer):
def test_valid_json(tracer):
tracer._initialize_span_processors(appsec_enabled=True)

with tracer.trace("test", span_type=SpanTypes.WEB.value) as span:
with tracer.trace("test", span_type=SpanTypes.WEB) as span:
span.set_tag("http.url", "http://example.com/.git")
span.set_tag("http.status_code", "404")

Expand Down

0 comments on commit a8f2fa8

Please sign in to comment.