Skip to content

Conversation

@dgzlopes
Copy link
Contributor

@dgzlopes dgzlopes commented Jan 16, 2020

  • Sets status tags on the Jaeger span.
  • Removes TODO from the Jaeger integration that points to a closed issue with a merged PR.

Signed-off-by: Daniel González Lopes danielgonzalezlopes@gmail.com

Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
@dgzlopes dgzlopes requested a review from a team January 16, 2020 13:16
@codecov-io
Copy link

codecov-io commented Jan 16, 2020

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.26%. Comparing base (a40edf5) to head (ae76533).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #367      +/-   ##
==========================================
+ Coverage   85.13%   85.26%   +0.12%     
==========================================
  Files          38       38              
  Lines        1911     1920       +9     
  Branches      225      225              
==========================================
+ Hits         1627     1637      +10     
  Misses        219      219              
+ Partials       65       64       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mauriciovasquezbernal
Copy link
Member

I'm wondering if we should try to export the status in some way to Jaeger. Looking at https://github.com/jaegertracing/jaeger-idl/blob/master/thrift/jaeger.thrift it appears to me that there is not any status related field. Perhaps it could be encoded as a tag?

@dgzlopes
Copy link
Contributor Author

It sounds like a good idea @mauriciovasquezbernal.

From taking a quick look at the Go client, I think that they are doing exactly that.

@mauriciovasquezbernal
Copy link
Member

@dgzlopes do you have plans to implement that? If not I'll open an issue to keep track of it.

@dgzlopes
Copy link
Contributor Author

Sure, I'm happy to implement it @mauriciovasquezbernal. Meanwhile, I'm going to change the title and the status of this pull request.

@dgzlopes dgzlopes changed the title Remove status is missing TODO [WIP] Export span status to Jaeger Jan 17, 2020
@dgzlopes
Copy link
Contributor Author

Also, from taking a closer look at the Go implementation I see that they set an "error" tag in the Jaeger span if Status.Code is not OK. Do you think we should add that tag too?

@codeboten
Copy link
Contributor

Yes! That would be awesome.

@Oberon00
Copy link
Member

I think this is something that should be defined in the spec, similar to open-telemetry/opentelemetry-specification#380

@mauriciovasquezbernal
Copy link
Member

I opened an issue in the specs repo to track it open-telemetry/opentelemetry-specification#414.

Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
@dgzlopes dgzlopes changed the title [WIP] Export span status to Jaeger Export span status to Jaeger Jan 22, 2020
@dgzlopes
Copy link
Contributor Author

dgzlopes commented Jan 22, 2020

I'm researching why Travis is failing. Locally all the test-ext-jaeger tests are passing.

Update: Now I'm able to reproduce it locally :)

Based on the changes of open-telemetry#358

Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
Copy link
Member

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

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

It looks good to me, just two small nits.
Thanks!

Signed-off-by: dgzlopes <danielgonzalezlopes@gmail.com>
Copy link
Contributor Author

@dgzlopes dgzlopes left a comment

Choose a reason for hiding this comment

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

Fixed nits related with magic numbers on tests :)

Copy link
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.

Thanks so much for tackling this. Just one change requested, the rest looks good!

# TODO: status is missing:
# https://github.com/open-telemetry/opentelemetry-python/issues/98
if tags is None:
tags = []
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be easier to change _extract_tags to always return an empty list, rather than checking this here

Copy link
Contributor

Choose a reason for hiding this comment

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

And in fact we probably should since the only other place where it's used also ends up doing some juggling around this:

fields = []
if event.attributes is not None:
fields = _extract_tags(event.attributes)
fields.append(

Copy link
Contributor Author

@dgzlopes dgzlopes Jan 22, 2020

Choose a reason for hiding this comment

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

Fixed! Added the check when span.status wasn't mandatory, but now it makes no sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

mind updating the in _extract_logs_from_span as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But if we change _extract_logs_from_span to return an empty list when a span has no logs tests break because they expect logs to be None. I think that it's the same with refs.

# Example output form tests
Span([348 chars]Double=None, vBool=None, vLong=None, vBinary=None)], logs=[])
Span([348 chars]Double=None, vBool=None, vLong=None, vBinary=None)], logs=None)

Maybe I'm misunderstanding something. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I meant to update the code in _extract_logs_from_span to take advantage of this new empty list from _extract_tags, lines 239 and 240 are no longer needed:

fields = []
if event.attributes is not None:
fields = _extract_tags(event.attributes)
fields.append(

Copy link
Contributor Author

@dgzlopes dgzlopes Jan 22, 2020

Choose a reason for hiding this comment

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

Oh, okay! It should be updated now.

Signed-off-by: dgzlopes <danielgonzalezlopes@gmail.com>
Signed-off-by: Daniel González Lopes <danielgonzalezlopes@gmail.com>
Copy link
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.

Looks good to me.

Copy link
Member

@mauriciovasquezbernal mauriciovasquezbernal left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, it looks good to me.
Just pushed a commit to update the changelog for it.

@mauriciovasquezbernal mauriciovasquezbernal added the PR:please merge This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.) label Jan 28, 2020
@c24t c24t merged commit 3995075 into open-telemetry:master Jan 29, 2020
@c24t c24t removed the PR:please merge This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.) label Jan 29, 2020
toumorokoshi pushed a commit to toumorokoshi/opentelemetry-python that referenced this pull request Feb 17, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants