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

Support a single Resource per MeterProvider in the SDK #2120

Merged
merged 24 commits into from
Aug 12, 2021

Conversation

jmacd
Copy link
Contributor

@jmacd jmacd commented Jul 22, 2021

The specification for Resource SDK says that there can be just one Resource used by an individual MeterProvider (and TraceProvider). This implies we can simplify the export path to use a single Resource per Export(), which simplifies the OTLP Exporter substantially.

What changes:

  • export.Record no longer contains a *resource.Resource
  • Export() methods now receive a single *resource.Resource
  • sdk/metric/controller/basic now passes the *resource.Resource to Export() directly
  • sdk/metric/sdk.go (the Accumulator) no longer touches a *resource.Resource
  • the exporters/otlp/otlpmetric code path no longer groups by *resource.Resource

Part of #2086.
Part of #2119.

@codecov
Copy link

codecov bot commented Jul 22, 2021

Codecov Report

Merging #2120 (55b6db5) into main (a8bb0bf) will decrease coverage by 0.0%.
The diff coverage is 82.6%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2120     +/-   ##
=======================================
- Coverage   72.8%   72.7%   -0.1%     
=======================================
  Files        177     177             
  Lines      12148   12126     -22     
=======================================
- Hits        8848    8825     -23     
+ Misses      3063    3062      -1     
- Partials     237     239      +2     
Impacted Files Coverage Δ
...rs/otlp/otlpmetric/internal/otlpmetrictest/data.go 0.0% <0.0%> (ø)
sdk/export/metric/metric.go 44.6% <0.0%> (+2.9%) ⬆️
sdk/metric/processor/basic/basic.go 98.4% <ø> (-0.1%) ⬇️
sdk/metric/processor/reducer/reducer.go 100.0% <ø> (ø)
sdk/metric/controller/basic/config.go 87.5% <50.0%> (ø)
sdk/metric/controller/basic/controller.go 90.9% <54.5%> (-3.1%) ⬇️
exporters/prometheus/prometheus.go 65.2% <83.3%> (ø)
bridge/opencensus/exporter.go 100.0% <100.0%> (ø)
exporters/otlp/otlpmetric/exporter.go 60.6% <100.0%> (ø)
...otlp/otlpmetric/internal/metrictransform/metric.go 79.0% <100.0%> (-1.0%) ⬇️
... and 5 more

CHANGELOG.md Outdated Show resolved Hide resolved
@MrAlias MrAlias added the area:metrics Part of OpenTelemetry Metrics label Aug 12, 2021
@MrAlias MrAlias merged commit 4e8d667 into open-telemetry:main Aug 12, 2021
@jmacd jmacd deleted the jmacd/remove_resource branch October 1, 2021 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics Part of OpenTelemetry Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants