Skip to content

Commit 572e5c9

Browse files
committed
[exporterhelper] Preserve request span context in the persistent queue
1 parent 1921e21 commit 572e5c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1508
-111
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
5+
component: exporterhelper
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: QueueBatchEncoding interface is changed to support marshaling and unmarshaling of request context.
9+
10+
# One or more tracking issues or pull requests related to the change
11+
issues: [13188]
12+
13+
# Optional: The change log or logs in which this entry should be included.
14+
# e.g. '[user]' or '[user, api]'
15+
# Include 'user' if the change is relevant to end users.
16+
# Include 'api' if there is a change to a library API.
17+
# Default: '[user]'
18+
change_logs: [api]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
5+
component: exporterhelper
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Add an option to preserve request span context in the persistent queue
9+
10+
# One or more tracking issues or pull requests related to the change
11+
issues: [11740]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext: |
17+
Currently, it is behind the exporter.PersistRequestContext feature gate, which can be enabled by adding
18+
`--feature-gates=exporter.PersistRequestContext` to the collector command line. An exporter buffer stored by
19+
a previous version of the collector (or by a collector with the feature gate disabled) can be read by a newer
20+
collector with the feature enabled. However, the reverse is not supported: a buffer stored by a newer collector with
21+
the feature enabled cannot be read by an older collector (or by a collector with the feature gate disabled).
22+
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: [user]

.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ coverage:
1919

2020
ignore:
2121
- "pdata/internal/data/protogen/**/*"
22+
- "**/*.pb.go"
2223
- "cmd/mdatagen/third_party/**/*"

.github/workflows/utils/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@
445445
"xexporter",
446446
"xexporterhelper",
447447
"xextension",
448+
"xpdata",
448449
"xpipeline",
449450
"xprocessor",
450451
"xprocessorhelper",

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ genpdata:
250250
pushd pdata/ && $(GOCMD) run ./internal/cmd/pdatagen/main.go && popd
251251
$(MAKE) fmt
252252

253-
INTERNAL_PROTO_SRC_DIRS := exporter/exporterhelper/internal/queue
254-
# INTERNAL_PROTO_SRC_DIRS += path/to/other/proto/dirs
253+
INTERNAL_PROTO_SRC_DIRS := exporter/exporterhelper/internal/queue pdata/xpdata/request/internal
255254
INTERNAL_PROTO_FILES := $(foreach dir,$(INTERNAL_PROTO_SRC_DIRS),$(wildcard $(dir)/*.proto))
256-
INTERNAL_PROTOC := $(DOCKERCMD) run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD} --go_out=${PWD}
255+
INTERNAL_PROTOC := $(DOCKERCMD) run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD} ${DOCKER_PROTOBUF} --proto_path=${PWD} -I/usr/include/github.com/gogo/protobuf -I${PWD}/$(PROTO_INTERMEDIATE_DIR) --go_out=${PWD}
257256

258257
.PHONY: genproto_internal
259258
genproto_internal:

cmd/builder/internal/builder/main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ var replaceModules = []string{
9595
"/pdata",
9696
"/pdata/testdata",
9797
"/pdata/pprofile",
98+
"/pdata/xpdata",
9899
"/pipeline",
99100
"/pipeline/xpipeline",
100101
"/processor",

cmd/otelcorecol/builder-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ replaces:
9696
- go.opentelemetry.io/collector/pdata => ../../pdata
9797
- go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata
9898
- go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile
99+
- go.opentelemetry.io/collector/pdata/xpdata => ../../pdata/xpdata
99100
- go.opentelemetry.io/collector/pipeline => ../../pipeline
100101
- go.opentelemetry.io/collector/pipeline/xpipeline => ../../pipeline/xpipeline
101102
- go.opentelemetry.io/collector/processor => ../../processor

cmd/otelcorecol/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ require (
122122
go.opentelemetry.io/collector/pdata v1.34.0 // indirect
123123
go.opentelemetry.io/collector/pdata/pprofile v0.128.0 // indirect
124124
go.opentelemetry.io/collector/pdata/testdata v0.128.0 // indirect
125+
go.opentelemetry.io/collector/pdata/xpdata v0.0.0-00010101000000-000000000000 // indirect
125126
go.opentelemetry.io/collector/pipeline v0.128.0 // indirect
126127
go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0 // indirect
127128
go.opentelemetry.io/collector/processor/processorhelper v0.128.0 // indirect
@@ -291,6 +292,8 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata
291292

292293
replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile
293294

295+
replace go.opentelemetry.io/collector/pdata/xpdata => ../../pdata/xpdata
296+
294297
replace go.opentelemetry.io/collector/pipeline => ../../pipeline
295298

296299
replace go.opentelemetry.io/collector/pipeline/xpipeline => ../../pipeline/xpipeline

exporter/debugexporter/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ require (
5050
go.opentelemetry.io/collector/extension/xextension v0.128.0 // indirect
5151
go.opentelemetry.io/collector/featuregate v1.34.0 // indirect
5252
go.opentelemetry.io/collector/internal/telemetry v0.128.0 // indirect
53+
go.opentelemetry.io/collector/pdata/xpdata v0.0.0-00010101000000-000000000000 // indirect
5354
go.opentelemetry.io/collector/pipeline v0.128.0 // indirect
5455
go.opentelemetry.io/collector/pipeline/xpipeline v0.128.0 // indirect
5556
go.opentelemetry.io/collector/receiver v1.34.0 // indirect
@@ -127,3 +128,5 @@ replace go.opentelemetry.io/collector/extension/xextension => ../../extension/xe
127128
replace go.opentelemetry.io/collector/internal/telemetry => ../../internal/telemetry
128129

129130
replace go.opentelemetry.io/collector/client => ../../client
131+
132+
replace go.opentelemetry.io/collector/pdata/xpdata => ../../pdata/xpdata

exporter/exporterhelper/internal/base_exporter_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ func newFakeQueueBatch() QueueBatchSettings[request.Request] {
162162

163163
type fakeEncoding struct{}
164164

165-
func (f fakeEncoding) Marshal(request.Request) ([]byte, error) {
165+
func (f fakeEncoding) Marshal(context.Context, request.Request) ([]byte, error) {
166166
return []byte("mockRequest"), nil
167167
}
168168

169-
func (f fakeEncoding) Unmarshal([]byte) (request.Request, error) {
170-
return &requesttest.FakeRequest{}, nil
169+
func (f fakeEncoding) Unmarshal([]byte) (context.Context, request.Request, error) {
170+
return context.Background(), &requesttest.FakeRequest{}, nil
171171
}

0 commit comments

Comments
 (0)