Skip to content

Commit 435707e

Browse files
authored
Upgrade otlp to 1.9.0 (#44031)
This is the contrib counterpart for open-telemetry/opentelemetry-collector#14128
1 parent cfa82aa commit 435707e

File tree

24 files changed

+211
-233
lines changed

24 files changed

+211
-233
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: exporter/elasticsearch
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Upgrade profiles proto to 1.9.0
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [44031]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

.chloggen/ottl-upgrade-otlp.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: pkg/ottl
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Upgrade profiles proto to 1.9.0
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [44031]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: receiver/pprof
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Upgrade profiles proto to 1.9.0
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [44031]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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. filelogreceiver)
7+
component: processor/filter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Upgrade profiles proto to 1.9.0
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [44031]
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+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

exporter/elasticsearchexporter/exporter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2772,7 +2772,7 @@ func TestExporterSendingQueueContextPropogation(t *testing.T) {
27722772

27732773
profile.AttributeIndices().Append(2)
27742774

2775-
sample := profile.Sample().AppendEmpty()
2775+
sample := profile.Samples().AppendEmpty()
27762776
sample.TimestampsUnixNano().Append(0)
27772777

27782778
stack := dic.StackTable().AppendEmpty()

exporter/elasticsearchexporter/internal/serializer/otelserializer/profile_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestSerializeProfile(t *testing.T) {
118118

119119
profile.AttributeIndices().Append(2)
120120

121-
sample := profile.Sample().AppendEmpty()
121+
sample := profile.Samples().AppendEmpty()
122122
sample.TimestampsUnixNano().Append(0)
123123
sample.AttributeIndices().Append(3)
124124
sample.SetStackIndex(0)

exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles/benchmark_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func BenchmarkTransform(b *testing.B) {
6767
pt.SetTypeStrindex(4)
6868
pt.SetUnitStrindex(5)
6969

70-
s := p.Sample().AppendEmpty()
70+
s := p.Samples().AppendEmpty()
7171
s.TimestampsUnixNano().Append(42)
7272
s.Values().Append(1)
7373

exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles/transform.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func checkProfileType(dic pprofile.ProfilesDictionary, profile pprofile.Profile)
7878
// stackPayloads creates a slice of StackPayloads from the given ResourceProfiles,
7979
// ScopeProfiles, and ProfileContainer.
8080
func stackPayloads(dic pprofile.ProfilesDictionary, resource pcommon.Resource, scope pcommon.InstrumentationScope, profile pprofile.Profile) ([]StackPayload, error) {
81-
unsymbolizedLeafFramesSet := make(map[frameID]struct{}, profile.Sample().Len())
81+
unsymbolizedLeafFramesSet := make(map[frameID]struct{}, profile.Samples().Len())
8282
unsymbolizedExecutablesSet := make(map[libpf.FileID]struct{})
83-
stackPayload := make([]StackPayload, 0, profile.Sample().Len())
83+
stackPayload := make([]StackPayload, 0, profile.Samples().Len())
8484

8585
hostMetadata := newHostMetadata(dic, resource, scope, profile)
8686

@@ -92,7 +92,7 @@ func stackPayloads(dic pprofile.ProfilesDictionary, resource pcommon.Resource, s
9292
frequency = 1
9393
}
9494

95-
for _, sample := range profile.Sample().All() {
95+
for _, sample := range profile.Samples().All() {
9696
frames, frameTypes, leafFrame, err := stackFrames(dic, sample)
9797
if err != nil {
9898
return nil, fmt.Errorf("failed to create stackframes: %w", err)
@@ -279,7 +279,7 @@ func stackFrames(dic pprofile.ProfilesDictionary, sample pprofile.Sample) ([]Sta
279279
locations := getLocations(dic, stack)
280280
totalFrames := 0
281281
for _, location := range locations {
282-
totalFrames += location.Line().Len()
282+
totalFrames += location.Lines().Len()
283283
}
284284
frameTypes := make([]libpf.FrameType, 0, totalFrames)
285285

@@ -296,11 +296,11 @@ func stackFrames(dic pprofile.ProfilesDictionary, sample pprofile.Sample) ([]Sta
296296
}
297297
frameTypes = append(frameTypes, libpf.FrameTypeFromString(frameTypeStr))
298298

299-
functionNames := make([]string, 0, location.Line().Len())
300-
fileNames := make([]string, 0, location.Line().Len())
301-
lineNumbers := make([]int32, 0, location.Line().Len())
299+
functionNames := make([]string, 0, location.Lines().Len())
300+
fileNames := make([]string, 0, location.Lines().Len())
301+
lineNumbers := make([]int32, 0, location.Lines().Len())
302302

303-
for _, line := range location.Line().All() {
303+
for _, line := range location.Lines().All() {
304304
if line.FunctionIndex() < int32(dic.FunctionTable().Len()) {
305305
functionNames = append(functionNames, getString(dic, int(dic.FunctionTable().At(int(line.FunctionIndex())).NameStrindex())))
306306
fileNames = append(fileNames, getString(dic, int(dic.FunctionTable().At(int(line.FunctionIndex())).FilenameStrindex())))
@@ -339,7 +339,7 @@ func getFrameID(dic pprofile.ProfilesDictionary, location pprofile.Location) *fr
339339
if fileID.IsZero() {
340340
// Synthesize a file ID if the htlhash build ID is not available.
341341
hasher := xxhash.New()
342-
for _, line := range location.Line().All() {
342+
for _, line := range location.Lines().All() {
343343
f := getFunction(dic, int(line.FunctionIndex()))
344344
_, _ = hasher.WriteString(getString(dic, int(f.NameStrindex())))
345345
_, _ = hasher.WriteString(getString(dic, int(f.FilenameStrindex())))
@@ -353,8 +353,8 @@ func getFrameID(dic pprofile.ProfilesDictionary, location pprofile.Location) *fr
353353
var addressOrLineno uint64
354354
if location.Address() > 0 {
355355
addressOrLineno = location.Address()
356-
} else if location.Line().Len() > 0 {
357-
addressOrLineno = uint64(location.Line().At(location.Line().Len() - 1).Line())
356+
} else if location.Lines().Len() > 0 {
357+
addressOrLineno = uint64(location.Lines().At(location.Lines().Len() - 1).Line())
358358
}
359359

360360
fID := newFrameID(fileID, libpf.AddressOrLineno(addressOrLineno))

exporter/elasticsearchexporter/internal/serializer/otelserializer/serializeprofiles/transform_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func TestTransform(t *testing.T) {
8888
pt.SetTypeStrindex(2)
8989
pt.SetUnitStrindex(3)
9090

91-
p.Sample().AppendEmpty()
91+
p.Samples().AppendEmpty()
9292

9393
return rp
9494
},
@@ -115,7 +115,7 @@ func TestTransform(t *testing.T) {
115115
st.SetTypeStrindex(0)
116116
st.SetUnitStrindex(1)
117117

118-
p.Sample().AppendEmpty()
118+
p.Samples().AppendEmpty()
119119

120120
return rp
121121
},
@@ -147,7 +147,7 @@ func TestTransform(t *testing.T) {
147147
pt.SetTypeStrindex(2)
148148
pt.SetUnitStrindex(3)
149149

150-
s := p.Sample().AppendEmpty()
150+
s := p.Samples().AppendEmpty()
151151
s.TimestampsUnixNano().Append(42)
152152

153153
return rp
@@ -211,7 +211,7 @@ func TestTransform(t *testing.T) {
211211
pt.SetTypeStrindex(4)
212212
pt.SetUnitStrindex(5)
213213

214-
s := p.Sample().AppendEmpty()
214+
s := p.Samples().AppendEmpty()
215215
s.TimestampsUnixNano().Append(42)
216216
s.Values().Append(1)
217217
s.SetStackIndex(0)
@@ -360,7 +360,7 @@ func TestStackPayloads(t *testing.T) {
360360
p := sp.Profiles().AppendEmpty()
361361
p.SetPeriod(1e9 / 20)
362362

363-
s := p.Sample().AppendEmpty()
363+
s := p.Samples().AppendEmpty()
364364
s.TimestampsUnixNano().Append(1)
365365
s.Values().Append(1)
366366
s.SetStackIndex(0)
@@ -475,7 +475,7 @@ func TestStackPayloads(t *testing.T) {
475475
p := sp.Profiles().AppendEmpty()
476476
p.SetPeriod(1e9 / 20)
477477

478-
s := p.Sample().AppendEmpty()
478+
s := p.Samples().AppendEmpty()
479479
s.TimestampsUnixNano().Append(1)
480480
s.Values().Append(2)
481481

@@ -600,7 +600,7 @@ func TestStackPayloads(t *testing.T) {
600600
p := sp.Profiles().AppendEmpty()
601601
p.SetPeriod(1e9 / 20)
602602

603-
s := p.Sample().AppendEmpty()
603+
s := p.Samples().AppendEmpty()
604604
s.TimestampsUnixNano().Append(1)
605605
s.Values().Append(1)
606606

@@ -711,7 +711,7 @@ func TestStackTraceEvent(t *testing.T) {
711711
sp := rp.ScopeProfiles().AppendEmpty()
712712
p := sp.Profiles().AppendEmpty()
713713

714-
p.Sample().AppendEmpty()
714+
p.Samples().AppendEmpty()
715715

716716
return rp
717717
},
@@ -737,7 +737,7 @@ func TestStackTraceEvent(t *testing.T) {
737737
sp := rp.ScopeProfiles().AppendEmpty()
738738
p := sp.Profiles().AppendEmpty()
739739

740-
p.Sample().AppendEmpty()
740+
p.Samples().AppendEmpty()
741741

742742
return rp
743743
},
@@ -763,7 +763,7 @@ func TestStackTraceEvent(t *testing.T) {
763763
sp := rp.ScopeProfiles().AppendEmpty()
764764
p := sp.Profiles().AppendEmpty()
765765

766-
p.Sample().AppendEmpty()
766+
p.Samples().AppendEmpty()
767767

768768
return rp
769769
},
@@ -804,7 +804,7 @@ func TestStackTraceEvent(t *testing.T) {
804804
sp := rp.ScopeProfiles().AppendEmpty()
805805
p := sp.Profiles().AppendEmpty()
806806

807-
s := p.Sample().AppendEmpty()
807+
s := p.Samples().AppendEmpty()
808808
s.AttributeIndices().Append(0, 1)
809809

810810
return rp
@@ -828,7 +828,7 @@ func TestStackTraceEvent(t *testing.T) {
828828
dic := tt.buildDictionary()
829829
rp := tt.buildResourceProfiles()
830830
p := rp.ScopeProfiles().At(0).Profiles().At(0)
831-
s := p.Sample().At(0)
831+
s := p.Samples().At(0)
832832

833833
hostMetadata := newHostMetadata(dic, rp.Resource(), rp.ScopeProfiles().At(0).Scope(), p)
834834
event := stackTraceEvent(dic, stacktraceIDBase64, s, 20, hostMetadata)
@@ -898,9 +898,9 @@ func TestStackTrace(t *testing.T) {
898898
l.SetAddress(address3)
899899
l.AttributeIndices().Append(2)
900900

901-
li := l.Line().AppendEmpty()
901+
li := l.Lines().AppendEmpty()
902902
li.SetLine(1)
903-
li = l.Line().AppendEmpty()
903+
li = l.Lines().AppendEmpty()
904904
li.SetLine(3)
905905

906906
// Create a location without build ID
@@ -912,7 +912,7 @@ func TestStackTrace(t *testing.T) {
912912
locWithoutBuildID := dic.LocationTable().AppendEmpty()
913913
locWithoutBuildID.SetMappingIndex(0)
914914
locWithoutBuildID.AttributeIndices().Append(0)
915-
li = locWithoutBuildID.Line().AppendEmpty()
915+
li = locWithoutBuildID.Lines().AppendEmpty()
916916
li.SetLine(99)
917917
stack.LocationIndices().Append(0, 1, 2, 3)
918918

@@ -928,7 +928,7 @@ func TestStackTrace(t *testing.T) {
928928
},
929929
buildProfile: func() pprofile.Profile {
930930
p := pprofile.NewProfile()
931-
p.Sample().AppendEmpty()
931+
p.Samples().AppendEmpty()
932932

933933
return p
934934
},
@@ -948,7 +948,7 @@ func TestStackTrace(t *testing.T) {
948948
t.Run(tt.name, func(t *testing.T) {
949949
dic := tt.buildDictionary()
950950
p := tt.buildProfile()
951-
s := p.Sample().At(0)
951+
s := p.Samples().At(0)
952952

953953
frames, frameTypes, _, err := stackFrames(dic, s)
954954
require.NoError(t, err)
@@ -1011,7 +1011,7 @@ func mkStackTraceID(t *testing.T, frameIDs []frameID) string {
10111011
for i := range frameIDs {
10121012
indices[i] = int32(i)
10131013
}
1014-
s := p.Sample().AppendEmpty()
1014+
s := p.Samples().AppendEmpty()
10151015

10161016
a := dic.AttributeTable().AppendEmpty()
10171017
a.SetKeyStrindex(0)

pkg/golden/golden_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func CreateTestProfiles() pprofile.Profiles {
396396

397397
profile.AttributeIndices().Append(2)
398398

399-
sample := profile.Sample().AppendEmpty()
399+
sample := profile.Samples().AppendEmpty()
400400
sample.TimestampsUnixNano().Append(0)
401401

402402
stack := dic.StackTable().AppendEmpty()

0 commit comments

Comments
 (0)