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

[pdatagen] Generate Metric type accessors #4811

Merged
merged 1 commit into from Feb 8, 2022

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Feb 5, 2022

Resolves #4782

@dmitryax dmitryax requested a review from a team as a code owner February 5, 2022 03:13
@project-bot project-bot bot added this to In progress in Collector Feb 5, 2022
@dmitryax dmitryax added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Feb 5, 2022
@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #4811 (566b23b) into main (7dcc512) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4811   +/-   ##
=======================================
  Coverage   90.76%   90.76%           
=======================================
  Files         180      180           
  Lines       10590    10590           
=======================================
  Hits         9612     9612           
  Misses        761      761           
  Partials      217      217           
Impacted Files Coverage Δ
model/pdata/metrics.go 97.84% <ø> (-0.49%) ⬇️
model/pdata/generated_metrics.go 97.14% <100.00%> (+0.08%) ⬆️

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 7dcc512...566b23b. Read the comment docs.

@dmitryax dmitryax requested review from bogdandrutu and removed request for tigrannajaryan February 7, 2022 18:43
@@ -1106,6 +1124,18 @@ func (ms NumberDataPoint) SetTimestamp(v Timestamp) {
(*ms.orig).TimeUnixNano = uint64(v)
}

// Type returns the type of the value for this NumberDataPoint.
// Calling this function on zero-initialized NumberDataPoint will cause a panic.
func (ms NumberDataPoint) Type() MetricValueType {
Copy link
Member

Choose a reason for hiding this comment

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

On the list of "may fix": MetricValueType does not sound as the best name for the enum. Maybe NumberValueType?
PointValueType? Not sure, just open an issue, this name does not sound very clear to me, because I would ask why Histogram is not a value type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. Filed an issue #4819

Collector automation moved this from In progress to Reviewer approved Feb 8, 2022
@bogdandrutu bogdandrutu merged commit cf00b30 into open-telemetry:main Feb 8, 2022
Collector automation moved this from Reviewer approved to Done Feb 8, 2022
@jpkrohling jpkrohling added this to the v0.45.0 milestone Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

[pdatagen] Generate types for Metric oneof fields
3 participants