Skip to content

Commit 09a2719

Browse files
authored
1 parent 3dbc211 commit 09a2719

31 files changed

+197
-317
lines changed

.chloggen/otlp-1-9-0.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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
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: Upgrade the OTLP protobuf definitions to version 1.9.0
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14128]
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]

.chloggen/profiles-otlp-1-9-0.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# cspell:ignore Strindices
2+
# Use this changelog template to create an entry for release notes.
3+
4+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
5+
change_type: breaking
6+
7+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
8+
component: pdata/pprofile
9+
10+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
11+
note: Upgrade the OTLP protobuf definitions to version 1.9.0
12+
13+
# One or more tracking issues or pull requests related to the change
14+
issues: [14128]
15+
16+
# (Optional) One or more lines of additional information to render under the primary note.
17+
# These lines will be padded with 2 spaces and then inserted directly into the document.
18+
# Use pipe (|) for multiline entries.
19+
subtext: |
20+
* Drop field `CommentStrindices` in `Profile`.
21+
* Rename `Sample` to `Samples` in `Profile`.
22+
* Rename `Line` to `Lines` in `Location`.
23+
* Remove `AggregationTemporality` field in `ValueType`.
24+
25+
See https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.9.0
26+
27+
# Optional: The change log or logs in which this entry should be included.
28+
# e.g. '[user]' or '[user, api]'
29+
# Include 'user' if the change is relevant to end users.
30+
# Include 'api' if there is a change to a library API.
31+
# Default: '[user]'
32+
change_logs: [api]

exporter/debugexporter/internal/normal/profiles.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (normalProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, er
4242
buffer.WriteString(profile.ProfileID().String())
4343

4444
buffer.WriteString(" samples=")
45-
buffer.WriteString(strconv.Itoa(profile.Sample().Len()))
45+
buffer.WriteString(strconv.Itoa(profile.Samples().Len()))
4646

4747
if profile.AttributeIndices().Len() > 0 {
4848
attrs := []string{}

exporter/debugexporter/internal/normal/profiles_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ func TestMarshalProfiles(t *testing.T) {
4343
profiles.ResourceProfiles().At(0).ScopeProfiles().At(0).Scope().SetVersion("1.2.3")
4444
profiles.ResourceProfiles().At(0).ScopeProfiles().At(0).Scope().Attributes().PutStr("scopeKey", "scopeValue")
4545
profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10})
46-
profile.Sample().AppendEmpty()
47-
profile.Sample().AppendEmpty()
46+
profile.Samples().AppendEmpty()
47+
profile.Samples().AppendEmpty()
4848
profile.AttributeIndices().Append(0)
4949
return profiles
5050
}(),

exporter/debugexporter/internal/otlptext/databuffer.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ func (b *dataBuffer) logProfileLocations(ls pprofile.LocationSlice) {
384384

385385
b.logEntry(" Mapping index: %d", location.MappingIndex())
386386
b.logEntry(" Address: %d", location.Address())
387-
if ll := location.Line().Len(); ll > 0 {
387+
if ll := location.Lines().Len(); ll > 0 {
388388
for j := range ll {
389389
b.logEntry(" Line #%d", j)
390-
line := location.Line().At(j)
390+
line := location.Lines().At(j)
391391
b.logEntry(" Function index: %d", line.FunctionIndex())
392392
b.logEntry(" Line: %d", line.Line())
393393
b.logEntry(" Column: %d", line.Column())
@@ -424,17 +424,6 @@ func (b *dataBuffer) logStringTable(ss pcommon.StringSlice) {
424424
}
425425
}
426426

427-
func (b *dataBuffer) logComment(c pcommon.Int32Slice) {
428-
if c.Len() == 0 {
429-
return
430-
}
431-
432-
b.logEntry(" Comment:")
433-
for i := 0; i < c.Len(); i++ {
434-
b.logEntry(" %d", c.At(i))
435-
}
436-
}
437-
438427
func keyValueAndUnitsToMap(aus pprofile.KeyValueAndUnitSlice) pcommon.Map {
439428
m := pcommon.NewMap()
440429
for i := 0; i < aus.Len(); i++ {

exporter/debugexporter/internal/otlptext/profiles.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ func (textProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, erro
5858
buf.logAttr("Duration", profile.Duration().String())
5959
buf.logAttr("Dropped attributes count", strconv.FormatUint(uint64(profile.DroppedAttributesCount()), 10))
6060

61-
buf.logProfileSamples(profile.Sample(), dic)
62-
buf.logComment(profile.CommentStrindices())
61+
buf.logProfileSamples(profile.Samples(), dic)
6362
}
6463
}
6564
}

exporter/debugexporter/internal/otlptext/profiles_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func extendProfiles(profiles pprofile.Profiles) pprofile.Profiles {
5656
location := dic.LocationTable().AppendEmpty()
5757
location.SetMappingIndex(3)
5858
location.SetAddress(4)
59-
line := location.Line().AppendEmpty()
59+
line := location.Lines().AppendEmpty()
6060
line.SetFunctionIndex(1)
6161
line.SetLine(2)
6262
line.SetColumn(3)
@@ -89,13 +89,9 @@ func extendProfiles(profiles pprofile.Profiles) pprofile.Profiles {
8989
sc := profiles.ResourceProfiles().At(0).ScopeProfiles().At(0)
9090
profilesCount := profiles.ResourceProfiles().At(0).ScopeProfiles().At(0).Profiles().Len()
9191
for i := range profilesCount {
92-
switch i % 2 {
93-
case 0:
92+
if i%2 == 0 {
9493
profile := sc.Profiles().At(i)
9594
profile.AttributeIndices().FromRaw([]int32{1})
96-
case 1:
97-
profile := sc.Profiles().At(i)
98-
profile.CommentStrindices().FromRaw([]int32{1, 2})
9995
}
10096
}
10197
return profiles
@@ -111,7 +107,7 @@ func generateProfilesWithEntityRefs() pprofile.Profiles {
111107
sp.Scope().SetName("test-scope")
112108
profile := sp.Profiles().AppendEmpty()
113109

114-
sample := profile.Sample().AppendEmpty()
110+
sample := profile.Samples().AppendEmpty()
115111
sample.Values().Append(100)
116112

117113
dic := pd.Dictionary()

exporter/debugexporter/internal/otlptext/testdata/profiles/two_profiles.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,3 @@ Profile #1
6262
Values: [9]
6363
Attributes:
6464
-> key: value
65-
Comment:
66-
1
67-
2

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

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ var profile = &messageStruct{
244244
returnMessage: valueType,
245245
},
246246
&SliceField{
247-
fieldName: "Sample",
247+
fieldName: "Samples",
248248
protoID: 2,
249249
protoType: proto.TypeMessage,
250250
returnSlice: sampleSlice,
@@ -277,16 +277,10 @@ var profile = &messageStruct{
277277
protoID: 6,
278278
protoType: proto.TypeInt64,
279279
},
280-
&SliceField{
281-
fieldName: "CommentStrindices",
282-
protoID: 7,
283-
protoType: proto.TypeInt32,
284-
returnSlice: int32Slice,
285-
},
286280
&TypedField{
287281
fieldName: "ProfileID",
288282
originFieldName: "ProfileId",
289-
protoID: 8,
283+
protoID: 7,
290284
returnType: &TypedType{
291285
structName: "ProfileID",
292286
protoType: proto.TypeMessage,
@@ -297,23 +291,23 @@ var profile = &messageStruct{
297291
},
298292
&PrimitiveField{
299293
fieldName: "DroppedAttributesCount",
300-
protoID: 9,
294+
protoID: 8,
301295
protoType: proto.TypeUint32,
302296
},
303297
&PrimitiveField{
304298
fieldName: "OriginalPayloadFormat",
305-
protoID: 10,
299+
protoID: 9,
306300
protoType: proto.TypeString,
307301
},
308302
&SliceField{
309303
fieldName: "OriginalPayload",
310-
protoID: 11,
304+
protoID: 10,
311305
protoType: proto.TypeBytes,
312306
returnSlice: byteSlice,
313307
},
314308
&SliceField{
315309
fieldName: "AttributeIndices",
316-
protoID: 12,
310+
protoID: 11,
317311
protoType: proto.TypeInt32,
318312
returnSlice: int32Slice,
319313
},
@@ -387,7 +381,7 @@ var valueTypeSlice = &messageSlice{
387381

388382
var valueType = &messageStruct{
389383
structName: "ValueType",
390-
description: "// ValueType describes the type and units of a value, with an optional aggregation temporality.",
384+
description: "// ValueType describes the type and units of a value.",
391385
protoName: "ValueType",
392386
upstreamProto: "gootlpprofiles.ValueType",
393387
fields: []Field{
@@ -401,17 +395,6 @@ var valueType = &messageStruct{
401395
protoID: 2,
402396
protoType: proto.TypeInt32,
403397
},
404-
&TypedField{
405-
fieldName: "AggregationTemporality",
406-
protoID: 3,
407-
returnType: &TypedType{
408-
structName: "AggregationTemporality",
409-
protoType: proto.TypeEnum,
410-
messageName: "AggregationTemporality",
411-
defaultVal: "AggregationTemporality(0)",
412-
testVal: "AggregationTemporality(1)",
413-
},
414-
},
415398
},
416399
}
417400

@@ -522,7 +505,7 @@ var location = &messageStruct{
522505
protoType: proto.TypeUint64,
523506
},
524507
&SliceField{
525-
fieldName: "Line",
508+
fieldName: "Lines",
526509
protoID: 3,
527510
protoType: proto.TypeMessage,
528511
returnSlice: lineSlice,

pdata/internal/generated_proto_location.go

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

0 commit comments

Comments
 (0)