Skip to content

Commit 7178c06

Browse files
committed
Fix pprofile DurationNano to be a TypeUint64
pcommon.Timestamp better represents a point in time rather than a duration. So keeping the proto field type for DurationNano is a better fit. Signed-off-by: Florian Lehner <[email protected]>
1 parent f498a89 commit 7178c06

File tree

4 files changed

+42
-22
lines changed

4 files changed

+42
-22
lines changed

.chloggen/profile-duration.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: breaking
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
7+
component: pkg/pdata
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: fix pprofile DurationNano to be a TypeUint64
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14188]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [api]

internal/cmd/pdatagen/internal/pdata/pprofile_package.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,10 @@ var profile = &messageStruct{
255255
protoID: 3,
256256
returnType: timestampType,
257257
},
258-
&TypedField{
259-
fieldName: "Duration",
260-
originFieldName: "DurationNano",
261-
protoID: 4,
262-
returnType: &TypedType{
263-
structName: "Timestamp",
264-
packageName: "pcommon",
265-
protoType: proto.TypeUint64,
266-
defaultVal: "0",
267-
testVal: "1234567890",
268-
},
258+
&PrimitiveField{
259+
fieldName: "DurationNano",
260+
protoID: 4,
261+
protoType: proto.TypeUint64,
269262
},
270263
&MessageField{
271264
fieldName: "PeriodType",

pdata/pprofile/generated_profile.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pdata/pprofile/generated_profile_test.go

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)