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

Switch to static resource references #790

Merged
merged 1 commit into from May 2, 2022

Conversation

jtescher
Copy link
Member

@jtescher jtescher commented May 1, 2022

The spec suggests all spans should have an associated Resource. This change switches trace config and span data from Option<Arc<Resource>> to Cow<'static, Resource> and removes Config::with_no_resource to accommodate this requirement.

@jtescher jtescher requested a review from a team as a code owner May 1, 2022 22:19
@codecov
Copy link

codecov bot commented May 1, 2022

Codecov Report

Merging #790 (90c28b0) into main (90a70ee) will decrease coverage by 0.0%.
The diff coverage is 75.5%.

❗ Current head 90c28b0 differs from pull request most recent head f121fdf. Consider uploading reports for the commit f121fdf to get more accurate results

@@           Coverage Diff           @@
##            main    #790     +/-   ##
=======================================
- Coverage   70.2%   70.1%   -0.1%     
=======================================
  Files        109     109             
  Lines       9012    8968     -44     
=======================================
- Hits        6330    6295     -35     
+ Misses      2682    2673      -9     
Impacted Files Coverage Δ
opentelemetry-datadog/src/exporter/mod.rs 24.4% <0.0%> (+0.2%) ⬆️
opentelemetry-jaeger/src/exporter/config/agent.rs 57.4% <ø> (-0.3%) ⬇️
...emetry-jaeger/src/exporter/config/collector/mod.rs 57.9% <ø> (ø)
opentelemetry-zipkin/src/exporter/mod.rs 0.0% <0.0%> (ø)
opentelemetry-sdk/src/resource/mod.rs 92.6% <75.0%> (+<0.1%) ⬆️
opentelemetry-sdk/src/trace/config.rs 23.8% <75.0%> (+1.3%) ⬆️
opentelemetry-datadog/src/exporter/model/mod.rs 77.3% <100.0%> (ø)
...aeger/src/exporter/config/collector/http_client.rs 23.0% <100.0%> (-0.9%) ⬇️
opentelemetry-jaeger/src/exporter/config/mod.rs 75.0% <100.0%> (-8.1%) ⬇️
opentelemetry-sdk/src/export/trace/mod.rs 100.0% <100.0%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90a70ee...f121fdf. Read the comment docs.

Copy link
Contributor

@TommyCpp TommyCpp 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 👍 Curious how does the benchmark look like

The spec suggests all spans should have an associated `Resource`. This
change switches trace config and span data from `Option<Arc<Resource>>`
to `Cow<'static, Resource>` and removes `Config::with_no_resource` to
accommodate this requirement.
@jtescher
Copy link
Member Author

jtescher commented May 2, 2022

@TommyCpp I don't think the benchmarks should change all that much as Arc::clone is not all that expensive, but this is more spec compliant and a few nanoseconds faster per span 👍

@jtescher jtescher merged commit 02e15b2 into open-telemetry:main May 2, 2022
@jtescher jtescher deleted the cow-resource branch May 2, 2022 15:11
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.

None yet

2 participants