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

ext/jaeger: add span kind jaeger exporter #387

Merged
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
1 change: 1 addition & 0 deletions ext/opentelemetry-ext-jaeger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Export span status ([#367](https://github.com/open-telemetry/opentelemetry-python/pull/367))
- Export span kind ([#387](https://github.com/open-telemetry/opentelemetry-python/pull/387))

## 0.3a0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def _translate_to_jaeger(spans: Span):
[
_get_long_tag("status.code", status.canonical_code.value),
_get_string_tag("status.message", status.description),
_get_string_tag("span.kind", span.kind.name),
]
)

Expand Down
17 changes: 14 additions & 3 deletions ext/opentelemetry-ext-jaeger/tests/test_jaeger_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_translate_to_jaeger(self):
context=other_context, attributes=link_attributes
)

default_status_tags = [
default_tags = [
jaeger.Tag(
key="status.code",
vType=jaeger.TagType.LONG,
Expand All @@ -165,6 +165,11 @@ def test_translate_to_jaeger(self):
jaeger.Tag(
key="status.message", vType=jaeger.TagType.STRING, vStr=None,
),
jaeger.Tag(
key="span.kind",
vType=jaeger.TagType.STRING,
vStr=trace_api.SpanKind.INTERNAL.name,
),
]

otel_spans = [
Expand All @@ -174,6 +179,7 @@ def test_translate_to_jaeger(self):
parent=parent_context,
events=(event,),
links=(link,),
kind=trace_api.SpanKind.CLIENT,
),
trace.Span(
name=span_names[1], context=parent_context, parent=None
Expand Down Expand Up @@ -234,6 +240,11 @@ def test_translate_to_jaeger(self):
vType=jaeger.TagType.STRING,
vStr="Example description",
),
jaeger.Tag(
key="span.kind",
vType=jaeger.TagType.STRING,
vStr=trace_api.SpanKind.CLIENT.name,
),
jaeger.Tag(
key="error", vType=jaeger.TagType.BOOL, vBool=True,
),
Expand Down Expand Up @@ -283,7 +294,7 @@ def test_translate_to_jaeger(self):
startTime=start_times[1] // 10 ** 3,
duration=durations[1] // 10 ** 3,
flags=0,
tags=default_status_tags,
tags=default_tags,
),
jaeger.Span(
operationName=span_names[2],
Expand All @@ -294,7 +305,7 @@ def test_translate_to_jaeger(self):
startTime=start_times[2] // 10 ** 3,
duration=durations[2] // 10 ** 3,
flags=0,
tags=default_status_tags,
tags=default_tags,
),
]

Expand Down