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

Updating OT exporter to consume latest version of OpenTelemetry API/SDK #15289

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from opentelemetry.sdk.trace.export import SpanExporter, SpanExportResult
from opentelemetry.sdk.util import ns_to_iso_str
from opentelemetry.trace import Span, SpanKind
from opentelemetry.trace.status import StatusCanonicalCode
from opentelemetry.trace.status import StatusCode

from microsoft.opentelemetry.exporter.azuremonitor import utils
from microsoft.opentelemetry.exporter.azuremonitor._generated.models import (
Expand Down Expand Up @@ -80,9 +80,9 @@ def convert_span_to_envelope(span: Span) -> TelemetryItem:
data = RequestData(
id="{:016x}".format(span.context.span_id),
duration=utils.ns_to_duration(span.end_time - span.start_time),
response_code=str(span.status.canonical_code.value),
success=span.status.canonical_code
== StatusCanonicalCode.OK, # Modify based off attributes or Status
response_code=str(span.status.status_code.value),
success=span.status.status_code
== StatusCode.OK, # Modify based off attributes or Status
properties={},
)
envelope.data = MonitorBase(base_data=data, base_type="RequestData")
Expand All @@ -108,10 +108,10 @@ def convert_span_to_envelope(span: Span) -> TelemetryItem:
data = RemoteDependencyData(
name=span.name,
id="{:016x}".format(span.context.span_id),
result_code=str(span.status.canonical_code.value),
result_code=str(span.status.status_code.value),
duration=utils.ns_to_duration(span.end_time - span.start_time),
success=span.status.canonical_code
== StatusCanonicalCode.OK, # Modify based off attributes or Status
success=span.status.status_code
== StatusCode.OK, # Modify based off attributes or Status
properties={},
)
envelope.data = MonitorBase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
install_requires=[
"azure-core<2.0.0,>=1.6.0",
"msrest>=0.6.10",
"opentelemetry-api == 0.13b0",
"opentelemetry-sdk == 0.13b0"
"opentelemetry-api == 0.15b0",
"opentelemetry-sdk == 0.15b0"
],
)
Loading