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

mark IntGauge/IntSum/IntDataPoint as deprecated #3707

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/pdatagen/internal/base_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const messageValueTemplate = `${description}
//
// Must use New${structName} function to create new instances.
// Important: zero-initialized instance is not valid for use.
// ${deprecated}
type ${structName} struct {
orig *${originName}
}
Expand Down Expand Up @@ -78,6 +79,7 @@ type messageValueStruct struct {
structName string
description string
originFullName string
deprecated string
fields []baseField
}

Expand All @@ -94,6 +96,8 @@ func (ms *messageValueStruct) generateStruct(sb *strings.Builder) {
return ms.originFullName
case "description":
return ms.description
case "deprecated":
return ms.deprecated
default:
panic(name)
}
Expand Down
3 changes: 3 additions & 0 deletions cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ var intGauge = &messageValueStruct{
structName: "IntGauge",
description: "// IntGauge represents the type of a int scalar metric that always exports the \"current value\" for every data point.",
originFullName: "otlpmetrics.IntGauge",
deprecated: "Deprecated: Use Gauge instead.",
fields: []baseField{
&sliceField{
fieldName: "DataPoints",
Expand All @@ -156,6 +157,7 @@ var intSum = &messageValueStruct{
structName: "IntSum",
description: "// IntSum represents the type of a numeric int scalar metric that is calculated as a sum of all reported measurements over a time interval.",
originFullName: "otlpmetrics.IntSum",
deprecated: "Deprecated: Use Sum instead.",
fields: []baseField{
aggregationTemporalityField,
isMonotonicField,
Expand Down Expand Up @@ -218,6 +220,7 @@ var intDataPoint = &messageValueStruct{
structName: "IntDataPoint",
description: "// IntDataPoint is a single data point in a timeseries that describes the time-varying values of a scalar int metric.",
originFullName: "otlpmetrics.IntDataPoint",
deprecated: "Deprecated: Use NumberDataPoint instead.",
fields: []baseField{
labelsField,
startTimeField,
Expand Down
1 change: 1 addition & 0 deletions model/pdata/generated_common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions model/pdata/generated_log.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions model/pdata/generated_metrics.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions model/pdata/generated_resource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions model/pdata/generated_trace.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.