Skip to content

Commit

Permalink
Update opentelemtry to the latest version (#16570)
Browse files Browse the repository at this point in the history
* ot update

* c-2

* update changelog

* dict getter

* Update sdk/core/azure-core-tracing-opentelemetry/azure/core/tracing/ext/opentelemetry_span/__init__.py

* decouple tracer provider with tracer
  • Loading branch information
Rakshith Bhyravabhotla authored Feb 5, 2021
1 parent 8bdca10 commit e596c04
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion sdk/core/azure-core-tracing-opentelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

# Release History

## 1.0.0b8 (Unreleased)
## 1.0.0b8 (2021-02-08)

- Pinned opentelemetry-api to version 0.17b0

## 1.0.0b7 (2020-10-05)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from opentelemetry.context import attach, detach, get_current
from opentelemetry.propagators import extract, inject
from opentelemetry.trace.propagation import get_current_span as get_span_from_context
from opentelemetry.trace.propagation.textmap import DictGetter

from azure.core.tracing import SpanKind, HttpSpanMixin # pylint: disable=no-name-in-module

Expand Down Expand Up @@ -202,8 +203,8 @@ def link_from_headers(cls, headers, attributes=None):
:param headers: A key value pair dictionary
:type headers: dict
"""
ctx = extract(_get_headers_from_http_request_headers, headers)
span_ctx = get_span_from_context(ctx).get_context()
ctx = extract(DictGetter(), headers)
span_ctx = get_span_from_context(ctx).get_span_context()
current_span = cls.get_current_span()
current_span.links.append(Link(span_ctx, attributes))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-e ../../../tools/azure-sdk-tools
../azure-core
opentelemetry-sdk==0.13b0
opentelemetry-sdk==0.17b0
2 changes: 1 addition & 1 deletion sdk/core/azure-core-tracing-opentelemetry/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
],
python_requires=">=3.5.0",
install_requires=[
'opentelemetry-api==0.13b0',
'opentelemetry-api==0.17b0',
'azure-core<2.0.0,>=1.0.0',
],
extras_require={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_no_span_passed_in_with_no_environ(self, tracer):

def test_span(self, tracer):
with tracer.start_as_current_span("Root") as parent:
assert OpenTelemetrySpan.get_current_tracer().source is tracer.source
with OpenTelemetrySpan() as wrapped_span:
assert wrapped_span.span_instance is trace.get_current_span()

Expand Down
2 changes: 1 addition & 1 deletion shared_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ opentelemetry-sdk==0.16b1
#override azure-ai-metricsadvisor msrest>=0.6.12
#override azure-opentelemetry-exporter-azuremonitor azure-core<2.0.0,>=1.6.0
#override azure-opentelemetry-exporter-azuremonitor msrest>=0.6.10
#override azure-core-tracing-opentelemetry opentelemetry-api==0.13b0
#override azure-core-tracing-opentelemetry opentelemetry-api==0.17b0
#override azure-identity six>=1.12.0
#override azure-ai-formrecognizer
#override azure-ai-metricsadvisor

0 comments on commit e596c04

Please sign in to comment.