Skip to content

Zipkin: Update span boolean attribute conversion#1509

Merged
lzchen merged 4 commits intoopen-telemetry:masterfrom
srikanthccv:zipkin-bool-attrs
Jan 14, 2021
Merged

Zipkin: Update span boolean attribute conversion#1509
lzchen merged 4 commits intoopen-telemetry:masterfrom
srikanthccv:zipkin-bool-attrs

Conversation

@srikanthccv
Copy link
Copy Markdown
Member

Fixes #1508

@srikanthccv srikanthccv requested review from a team, hectorhdzg and owais and removed request for a team January 5, 2021 09:14

def _extract_tags_from_span(self, span: Span):
tags = self._extract_tags_from_dict(getattr(span, "attributes", None))
tags = self._extract_tags_from_dict(span.attributes)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was there a specific reason we were using getattr?

Copy link
Copy Markdown
Contributor

@owais owais Jan 5, 2021

Choose a reason for hiding this comment

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

May be because API Span does not have "attributes" attribute and it might be used as a noop span in some situations? That'd be my guess.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. Better of just leave it then. @lonewolf3739

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I dig into to see if I could find some relevant comments when this was added. #707 (comment) this was the discussion that introduced this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I am wondering If that is true we should be doing that all other attributes such as events, status, timestamps, kind and instrumentation_info etc.. and that should be done for not just zipkin but all exporters?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Does SpanProcessor not take care of discarding those DefaultSpans?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@toumorokoshi
Does this use case still apply?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this would happen (we check for DefaultSpan in the span processor and it should never reach the exporter).

Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@lzchen lzchen merged commit baa2fcb into open-telemetry:master Jan 14, 2021
@srikanthccv srikanthccv deleted the zipkin-bool-attrs branch September 24, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zipking Exporter: Boolean attribute values MUST use lower case strings "true" and "false"

4 participants