feat(metrics): add public constructors for metric data types#3489
Draft
darklight3it wants to merge 5 commits intoopen-telemetry:mainfrom
Draft
feat(metrics): add public constructors for metric data types#3489darklight3it wants to merge 5 commits intoopen-telemetry:mainfrom
darklight3it wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3489 +/- ##
=======================================
+ Coverage 83.7% 84.4% +0.7%
=======================================
Files 126 126
Lines 25386 25825 +439
=======================================
+ Hits 21255 21818 +563
+ Misses 4131 4007 -124 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
f3fc113 to
d3e1646
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3469
Changes
Added public constructors to metric data types, allowing users to use the public
PushMetricExporter::export.Rationale:
builderpattern, where the builder explicitly lists mandatory fields. This matches the established pattern inopentelemetry-sdk,opentelemetry-otlp, and other crates.newmethod.Summary:
with_*) fieldsResourceMetricsbuilder()resource,scope_metricsScopeMetricsbuilder()scope,metricsMetricbuilder(name, data)name,datadescription,unitGauge<T>builder(data_points, time)data_points,timestart_timeGaugeDataPoint<T>builder(value)valueattributes,exemplarsSum<T>new(...)data_points,temporality,is_monotonic,start_time,timeSumDataPoint<T>builder(value)valueattributes,exemplarsHistogram<T>new(...)data_points,temporality,start_time,timeHistogramDataPoint<T>builder(count, sum, bounds, bucket_counts)count,sum,bounds,bucket_countsattributes,min,max,exemplarsExponentialHistogram<T>new(...)data_points,temporality,start_time,timeExponentialHistogramDataPoint<T>builder(count, sum, scale, zero_count, positive_bucket, negative_bucket)count,sum,scale,zero_count,positive_bucket,negative_bucketattributes,min,max,zero_threshold,exemplarsExponentialBucketnew(offset, counts)offset,countsExemplar<T>builder(value, time)value,timefiltered_attributes,span_id,trace_idExample usage:
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes