Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase dependency #18500

Merged
merged 9 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/core/azure-core-tracing-opencensus/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
'opencensus>=0.6.0',
'opencensus-ext-azure>=0.3.1',
'opencensus-ext-threading',
'azure-core<2.0.0,>=1.0.0',
'azure-core<2.0.0,>=1.13.0',
rakshith91 marked this conversation as resolved.
Show resolved Hide resolved
],
extras_require={
":python_version<'3.5'": ['typing'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def test_set_http_attributes(self):
setattr(request, "headers", {})
setattr(response, "status_code", 200)
wrapped_class.set_http_attributes(request)
assert wrapped_class.span_instance.span_kind == OpenCensusSpanKind.CLIENT
assert wrapped_class.span_instance.attributes.get("http.method") == request.method
assert wrapped_class.span_instance.attributes.get("component") == "http"
assert wrapped_class.span_instance.attributes.get("http.url") == request.url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_add_attribute(self, tracer):
assert parent.attributes["test"] == "test2"

def test_set_http_attributes(self, tracer):
with tracer.start_as_current_span("Root") as parent:
with tracer.start_as_current_span("Root", kind=OpenTelemetrySpanKind.CLIENT) as parent:
wrapped_class = OpenTelemetrySpan(span=parent)
request = mock.Mock()
setattr(request, "method", "GET")
Expand All @@ -148,6 +148,7 @@ def test_set_http_attributes(self, tracer):
setattr(request, "headers", {})
setattr(response, "status_code", 200)
wrapped_class.set_http_attributes(request)
assert wrapped_class.span_instance.kind == OpenTelemetrySpanKind.CLIENT
assert wrapped_class.span_instance.attributes.get("http.method") == request.method
assert wrapped_class.span_instance.attributes.get("component") == "http"
assert wrapped_class.span_instance.attributes.get("http.url") == request.url
Expand Down
1 change: 1 addition & 0 deletions sdk/core/azure-core/azure/core/tracing/_abstract_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ def set_http_attributes(self, request, response=None):
:param response: The response received by the server. Is None if no response received.
:type response: ~azure.core.pipeline.transport.HttpResponse or ~azure.core.pipeline.transport.AsyncHttpResponse
"""
self.kind = SpanKind.CLIENT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're changing the behavior of the mixin, why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually - i already added the kind in the distributed tracing policy and removed it from here previously in this PR
#17785

  • duplicating this line here ensures backward compatibility with previosuly released versions of azure-core-tracing-opentelemetry

self.add_attribute(self._SPAN_COMPONENT, "http")
self.add_attribute(self._HTTP_METHOD, request.method)
self.add_attribute(self._HTTP_URL, request.url)
Expand Down
2 changes: 1 addition & 1 deletion shared_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pyjwt>=1.7.1
#override azure azure-keyvault~=1.0
#override azure-mgmt-core azure-core<2.0.0,>=1.13.0
#override azure-containerregistry azure-core>=1.4.0,<2.0.0
#override azure-core-tracing-opencensus azure-core<2.0.0,>=1.0.0
#override azure-core-tracing-opencensus azure-core<2.0.0,>=1.13.0
rakshith91 marked this conversation as resolved.
Show resolved Hide resolved
#override azure-core-tracing-opentelemetry azure-core<2.0.0,>=1.13.0
#override azure-cosmos azure-core<2.0.0,>=1.0.0
#override azure-data-tables azure-core<2.0.0,>=1.13.0
Expand Down