Skip to content

Commit e23802a

Browse files
authored
Upgrade pdata to v1.5.0 (open-telemetry#11932)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Proto 1.5.0 has been released. This upgrades pdata to use that version. See https://github.com/open-telemetry/opentelemetry-proto/releases/tag/v1.5.0
1 parent 50104db commit e23802a

File tree

20 files changed

+546
-613
lines changed

20 files changed

+546
-613
lines changed

.chloggen/pdata-1-5-0.yaml

+25
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: 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 pdata to opentelemetry-proto v1.5.0
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [11932]
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-pdata-1-5-0.yaml

+25
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. otlpreceiver)
7+
component: pdata/pprofile
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Remove duplicate Attributes field from profile
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [11932]
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]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ ocb:
171171
OPENTELEMETRY_PROTO_SRC_DIR=pdata/internal/opentelemetry-proto
172172

173173
# The branch matching the current version of the proto to use
174-
OPENTELEMETRY_PROTO_VERSION=v1.4.0
174+
OPENTELEMETRY_PROTO_VERSION=v1.5.0
175175

176176
# Find all .proto files.
177177
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1development/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1development/*.proto))

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ calls and don't want them to feel excluded.
9797

9898
## Supported OTLP version
9999

100-
This code base is currently built against using OTLP protocol v1.4.0,
100+
This code base is currently built against using OTLP protocol v1.5.0,
101101
considered Stable. [See the OpenTelemetry Protocol Stability
102102
definition
103103
here.](https://github.com/open-telemetry/opentelemetry-proto?tab=readme-ov-file#stability-definition)

exporter/debugexporter/internal/normal/profiles.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package normal // import "go.opentelemetry.io/collector/exporter/debugexporter/i
55

66
import (
77
"bytes"
8+
"fmt"
89
"strconv"
910
"strings"
1011

@@ -35,10 +36,15 @@ func (normalProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, er
3536
buffer.WriteString(" samples=")
3637
buffer.WriteString(strconv.Itoa(profile.Sample().Len()))
3738

38-
if profile.Attributes().Len() > 0 {
39-
profileAttributes := writeAttributes(profile.Attributes())
39+
if profile.AttributeIndices().Len() > 0 {
40+
attrs := []string{}
41+
for _, i := range profile.AttributeIndices().AsRaw() {
42+
a := profile.AttributeTable().At(int(i))
43+
attrs = append(attrs, fmt.Sprintf("%s=%s", a.Key(), a.Value().AsString()))
44+
}
45+
4046
buffer.WriteString(" ")
41-
buffer.WriteString(strings.Join(profileAttributes, " "))
47+
buffer.WriteString(strings.Join(attrs, " "))
4248
}
4349

4450
buffer.WriteString("\n")

exporter/debugexporter/internal/normal/profiles_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ func TestMarshalProfiles(t *testing.T) {
3131
profile.SetProfileID([16]byte{0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10})
3232
profile.Sample().AppendEmpty()
3333
profile.Sample().AppendEmpty()
34-
profile.Attributes().PutStr("key1", "value1")
34+
profile.AttributeIndices().Append(0)
35+
a := profile.AttributeTable().AppendEmpty()
36+
a.SetKey("key1")
37+
a.Value().SetStr("value1")
3538
return profiles
3639
}(),
3740
expected: `0102030405060708090a0b0c0d0e0f10 samples=2 key1=value1

exporter/debugexporter/internal/otlptext/profiles.go

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func (textProfilesMarshaler) MarshalProfiles(pd pprofile.Profiles) ([]byte, erro
3838
buf.logAttr("Profile ID", profile.ProfileID())
3939
buf.logAttr("Start time", profile.Time().String())
4040
buf.logAttr("Duration", profile.Duration().String())
41-
buf.logAttributes("Attributes", profile.Attributes())
4241
buf.logAttr("Dropped attributes count", strconv.FormatUint(uint64(profile.DroppedAttributesCount()), 10))
4342
buf.logEntry(" Location indices: %d", profile.LocationIndices().AsRaw())
4443

pdata/internal/cmd/pdatagen/internal/plog_package.go

+6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ var logRecord = &messageValueStruct{
106106
testVal: "1",
107107
},
108108
},
109+
&primitiveField{
110+
fieldName: "EventName",
111+
returnType: "string",
112+
defaultVal: `""`,
113+
testVal: `""`,
114+
},
109115
&primitiveField{
110116
fieldName: "SeverityText",
111117
returnType: "string",

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ var profile = &messageValueStruct{
204204
},
205205
},
206206
&sliceField{
207-
fieldName: "Attributes",
208-
returnSlice: mapStruct,
207+
fieldName: "AttributeIndices",
208+
returnSlice: int32Slice,
209209
},
210210
droppedAttributesCount,
211211
&primitiveField{

0 commit comments

Comments
 (0)