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

Expose non-nullable metric types #2208

Merged
merged 1 commit into from
Nov 24, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/pdatagen/internal/metrics_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var metric = &messagePtrStruct{
},
}

var intGauge = &messagePtrStruct{
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",
Expand All @@ -140,7 +140,7 @@ var intGauge = &messagePtrStruct{
},
}

var doubleGauge = &messagePtrStruct{
var doubleGauge = &messageValueStruct{
structName: "DoubleGauge",
description: "// DoubleGauge represents the type of a double scalar metric that always exports the \"current value\" for every data point.",
originFullName: "otlpmetrics.DoubleGauge",
Expand All @@ -153,7 +153,7 @@ var doubleGauge = &messagePtrStruct{
},
}

var intSum = &messagePtrStruct{
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",
Expand All @@ -168,7 +168,7 @@ var intSum = &messagePtrStruct{
},
}

var doubleSum = &messagePtrStruct{
var doubleSum = &messageValueStruct{
structName: "DoubleSum",
description: "// DoubleSum represents the type of a numeric double scalar metric that is calculated as a sum of all reported measurements over a time interval.",
originFullName: "otlpmetrics.DoubleSum",
Expand All @@ -183,7 +183,7 @@ var doubleSum = &messagePtrStruct{
},
}

var intHistogram = &messagePtrStruct{
var intHistogram = &messageValueStruct{
structName: "IntHistogram",
description: "// IntHistogram represents the type of a metric that is calculated by aggregating as a Histogram of all reported double measurements over a time interval.",
originFullName: "otlpmetrics.IntHistogram",
Expand All @@ -197,7 +197,7 @@ var intHistogram = &messagePtrStruct{
},
}

var doubleHistogram = &messagePtrStruct{
var doubleHistogram = &messageValueStruct{
structName: "DoubleHistogram",
description: "// DoubleHistogram represents the type of a metric that is calculated by aggregating as a Histogram of all reported double measurements over a time interval.",
originFullName: "otlpmetrics.DoubleHistogram",
Expand All @@ -211,7 +211,7 @@ var doubleHistogram = &messagePtrStruct{
},
}

var doubleSummary = &messagePtrStruct{
var doubleSummary = &messageValueStruct{
structName: "DoubleSummary",
description: "// DoubleSummary represents the type of a metric that is calculated by aggregating as a Summary of all reported double measurements over a time interval.",
originFullName: "otlpmetrics.DoubleSummary",
Expand Down Expand Up @@ -488,6 +488,6 @@ var aggregationTemporalityField = &primitiveTypedField{
var oneofDataField = &oneofField{
copyFuncName: "copyData",
originFieldName: "Data",
testVal: "&otlpmetrics.Metric_IntGauge{}",
testVal: "&otlpmetrics.Metric_IntGauge{IntGauge: &otlpmetrics.IntGauge{}}",
fillTestName: "IntGauge",
}
7 changes: 4 additions & 3 deletions cmd/pdatagen/internal/trace_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package internal
var traceFile = &File{
Name: "trace",
imports: []string{
`"go.opentelemetry.io/collector/internal/data"`,
`otlpcommon "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/common/v1"`,
`otlptrace "go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/trace/v1"`,
},
Expand Down Expand Up @@ -217,7 +218,7 @@ var traceIDField = &primitiveTypedField{
fieldName: "TraceID",
originFieldName: "TraceId",
returnType: "TraceID",
rawType: "otlpcommon.TraceID",
rawType: "data.TraceID",
defaultVal: "NewTraceID([16]byte{})",
testVal: "NewTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1})",
}
Expand All @@ -226,7 +227,7 @@ var spanIDField = &primitiveTypedField{
fieldName: "SpanID",
originFieldName: "SpanId",
returnType: "SpanID",
rawType: "otlpcommon.SpanID",
rawType: "data.SpanID",
defaultVal: "NewSpanID([8]byte{})",
testVal: "NewSpanID([8]byte{1, 2, 3, 4, 5, 6, 7, 8})",
}
Expand All @@ -235,7 +236,7 @@ var parentSpanIDField = &primitiveTypedField{
fieldName: "ParentSpanID",
originFieldName: "ParentSpanId",
returnType: "SpanID",
rawType: "otlpcommon.SpanID",
rawType: "data.SpanID",
defaultVal: "NewSpanID([8]byte{})",
testVal: "NewSpanID([8]byte{8, 7, 6, 5, 4, 3, 2, 1})",
}
Expand Down
Loading