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

OT shim: Link to documentation in comments about time imprecision #245

Closed
johananl opened this issue Oct 25, 2019 · 1 comment · Fixed by #312
Closed

OT shim: Link to documentation in comments about time imprecision #245

johananl opened this issue Oct 25, 2019 · 1 comment · Fixed by #312
Assignees
Labels
shim OpenTracing or OpenCensus compatibility tracing
Milestone

Comments

@johananl
Copy link
Contributor

Due to inherent inaccuracies in binary floating point arithmetic, the OT shim's implementation has slight imprecision when converting time values from the OT format to the OTel format and vice versa.
For the user it may not matter too much. In the tests, we tolerate imprecision of up to 1 microsecond using assertAlmostEqual().

This problem has been explained in detail in the docs (#244) which aren't merged at the time of writing:

https://github.com/kinvolk/opentelemetry-python/blob/bd020e9720f343a5a370cfb673df7beb4a98ac44/ext/opentelemetry-ext-opentracing-shim/src/opentelemetry/ext/opentracing_shim/__init__.py#L51-L78

I've added TODOs in the relevant places in the tests:

# Tolerate inaccuracies of less than a microsecond.
# TODO: Put a link to an explanation in the docs.
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.

# Tolerate inaccuracies of less than a microsecond.
# TODO: Put a link to an explanation in the docs.
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.

# Tolerate inaccuracies of less than a microsecond.
# TODO: Put a link to an explanation in the docs.
# TODO: This seems to work consistently, but we should find out the
# biggest possible loss of precision.

We should add a link to the relevant part in the official docs once merged.

@Oberon00 Oberon00 added shim OpenTracing or OpenCensus compatibility tracing labels Oct 28, 2019
@c24t
Copy link
Member

c24t commented Oct 31, 2019

Likely fixed by #244

@c24t c24t added this to the Alpha v0.3 milestone Oct 31, 2019
@codeboten codeboten self-assigned this Nov 29, 2019
@c24t c24t closed this as completed in #312 Dec 3, 2019
c24t pushed a commit that referenced this issue Dec 3, 2019
codeboten pushed a commit to codeboten/opentelemetry-python that referenced this issue Dec 4, 2019
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
* feat(plugin-http): add example

closes open-telemetry#245

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>

* refactor: removes duplicated code

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>

* fix: exporter variable

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>

* docs: add image for jaeger

Signed-off-by: Olivier Albertini <olivier.albertini@montreal.ca>

* chore: remove todo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shim OpenTracing or OpenCensus compatibility tracing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants