Skip to content

Commit 1113ef7

Browse files
Merge branch 'main' into add-splunk-rolling-restart-metric
2 parents 1a67042 + edb75a5 commit 1113ef7

File tree

41 files changed

+719
-903
lines changed

Some content is hidden

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

41 files changed

+719
-903
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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. filelogreceiver)
7+
component: postgresqlreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Reduce component footprint by removing the loading of unnecessary SQL drivers
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: [39918]
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+
Custom builds that are using the postgresql receiver and no other SQL related receivers
20+
will see a reduction in the output binary size. A similar effect is expected also for
21+
the sqlserverreceiver.
22+
23+
# If your change doesn't affect end users or the exported elements of any package,
24+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
25+
# Optional: The change log or logs in which this entry should be included.
26+
# e.g. '[user]' or '[user, api]'
27+
# Include 'user' if the change is relevant to end users.
28+
# Include 'api' if there is a change to a library API.
29+
# Default: '[user]'
30+
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: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: kafkaexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Make Sarama's ConfigurationError as permanent to prevent retries"
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: [38604]
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-beta.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: enhancement
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: OTTL is now officially considered Beta stability
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: [39910]
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: []

.chloggen/redact-log-body.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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: processor/redaction
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Apply redaction to log.body"
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: [37239]
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: []

connector/datadogconnector/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ require (
148148
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
149149
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
150150
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
151-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.214.0 // indirect
151+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.215.0 // indirect
152152
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
153153
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
154154
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect

connector/datadogconnector/go.sum

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

exporter/clickhouseexporter/example/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:latest@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS certs
22
RUN apk --update add ca-certificates
33

4-
FROM golang:latest@sha256:30baaea08c5d1e858329c50f29fe381e9b7d7bced11a0f5f1f69a1504cdfbf5e
4+
FROM golang:latest@sha256:39d9e7d9c5d9c9e4baf0d8fff579f06d5032c0f4425cdec9e86732e8e4e374dc
55

66
ARG USER_UID=10001
77
USER ${USER_UID}

exporter/datadogexporter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ require (
192192
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
193193
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
194194
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
195-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.214.0 // indirect
195+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.215.0 // indirect
196196
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
197197
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
198198
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect

exporter/datadogexporter/go.sum

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

exporter/datadogexporter/integrationtest/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ require (
150150
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.34 // indirect
151151
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.34 // indirect
152152
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
153-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.214.0 // indirect
153+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.215.0 // indirect
154154
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.3 // indirect
155155
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 // indirect
156156
github.com/aws/aws-sdk-go-v2/service/sso v1.25.3 // indirect

exporter/datadogexporter/integrationtest/go.sum

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

exporter/kafkaexporter/kafka_exporter.go

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,7 @@ func (e *kafkaExporter[T]) exportData(ctx context.Context, data T) error {
117117
ctx, e.cfg.IncludeMetadataKeys,
118118
))
119119
if err := e.producer.SendMessages(allSaramaMessages); err != nil {
120-
var prodErr sarama.ProducerErrors
121-
if errors.As(err, &prodErr) {
122-
if len(prodErr) > 0 {
123-
return kafkaErrors{len(prodErr), prodErr[0].Err.Error()}
124-
}
125-
}
126-
return err
120+
return wrapKafkaProducerError(err)
127121
}
128122
return nil
129123
}
@@ -342,3 +336,24 @@ func metadataToHeaders(ctx context.Context, keys []string) []sarama.RecordHeader
342336
}
343337
return headers
344338
}
339+
340+
func wrapKafkaProducerError(err error) error {
341+
var prodErr sarama.ProducerErrors
342+
if !errors.As(err, &prodErr) || len(prodErr) == 0 {
343+
return err
344+
}
345+
346+
var areConfigErrs bool
347+
var confErr sarama.ConfigurationError
348+
for _, producerErr := range prodErr {
349+
if areConfigErrs = errors.As(producerErr.Err, &confErr); !areConfigErrs {
350+
break
351+
}
352+
}
353+
354+
if areConfigErrs {
355+
return consumererror.NewPermanent(confErr)
356+
}
357+
358+
return kafkaErrors{len(prodErr), prodErr[0].Err.Error()}
359+
}

exporter/kafkaexporter/kafka_exporter_test.go

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"go.opentelemetry.io/collector/client"
1717
"go.opentelemetry.io/collector/component"
1818
"go.opentelemetry.io/collector/component/componenttest"
19+
"go.opentelemetry.io/collector/consumer/consumererror"
1920
"go.opentelemetry.io/collector/exporter/exportertest"
2021
"go.opentelemetry.io/collector/pdata/pcommon"
2122
"go.opentelemetry.io/collector/pdata/plog"
@@ -123,6 +124,27 @@ func TestTracesPusher_err(t *testing.T) {
123124
assert.EqualError(t, err, expErr.Error())
124125
}
125126

127+
func TestTracesPusher_conf_err(t *testing.T) {
128+
t.Run("should return permanent err on config error", func(t *testing.T) {
129+
expErr := sarama.ConfigurationError("configuration error")
130+
prodErrs := sarama.ProducerErrors{
131+
&sarama.ProducerError{Err: expErr},
132+
}
133+
host := extensionsHost{
134+
component.MustNewID("trace_encoding"): ptraceMarshalerFuncExtension(func(ptrace.Traces) ([]byte, error) {
135+
return nil, prodErrs
136+
}),
137+
}
138+
config := createDefaultConfig().(*Config)
139+
config.Traces.Encoding = "trace_encoding"
140+
exp, _ := newMockTracesExporter(t, *config, host)
141+
142+
err := exp.exportData(context.Background(), testdata.GenerateTraces(2))
143+
144+
assert.True(t, consumererror.IsPermanent(err))
145+
})
146+
}
147+
126148
func TestTracesPusher_marshal_error(t *testing.T) {
127149
marshalErr := errors.New("failed to marshal")
128150
host := extensionsHost{
@@ -349,6 +371,27 @@ func TestMetricsPusher_err(t *testing.T) {
349371
assert.EqualError(t, err, expErr.Error())
350372
}
351373

374+
func TestMetricsPusher_conf_err(t *testing.T) {
375+
t.Run("should return permanent err on config error", func(t *testing.T) {
376+
expErr := sarama.ConfigurationError("configuration error")
377+
prodErrs := sarama.ProducerErrors{
378+
&sarama.ProducerError{Err: expErr},
379+
}
380+
host := extensionsHost{
381+
component.MustNewID("metric_encoding"): ptraceMarshalerFuncExtension(func(ptrace.Traces) ([]byte, error) {
382+
return nil, prodErrs
383+
}),
384+
}
385+
config := createDefaultConfig().(*Config)
386+
config.Traces.Encoding = "metric_encoding"
387+
exp, _ := newMockTracesExporter(t, *config, host)
388+
389+
err := exp.exportData(context.Background(), testdata.GenerateTraces(2))
390+
391+
assert.True(t, consumererror.IsPermanent(err))
392+
})
393+
}
394+
352395
func TestMetricsPusher_marshal_error(t *testing.T) {
353396
marshalErr := errors.New("failed to marshal")
354397
host := extensionsHost{
@@ -521,6 +564,27 @@ func TestLogsPusher_err(t *testing.T) {
521564
assert.EqualError(t, err, expErr.Error())
522565
}
523566

567+
func TestLogsPusher_conf_err(t *testing.T) {
568+
t.Run("should return permanent err on config error", func(t *testing.T) {
569+
expErr := sarama.ConfigurationError("configuration error")
570+
prodErrs := sarama.ProducerErrors{
571+
&sarama.ProducerError{Err: expErr},
572+
}
573+
host := extensionsHost{
574+
component.MustNewID("log_encoding"): ptraceMarshalerFuncExtension(func(ptrace.Traces) ([]byte, error) {
575+
return nil, prodErrs
576+
}),
577+
}
578+
config := createDefaultConfig().(*Config)
579+
config.Traces.Encoding = "log_encoding"
580+
exp, _ := newMockTracesExporter(t, *config, host)
581+
582+
err := exp.exportData(context.Background(), testdata.GenerateTraces(2))
583+
584+
assert.True(t, consumererror.IsPermanent(err))
585+
})
586+
}
587+
524588
func TestLogsPusher_marshal_error(t *testing.T) {
525589
marshalErr := errors.New("failed to marshal")
526590
host := extensionsHost{
@@ -808,3 +872,64 @@ func newMockLogsExporter(t *testing.T, cfg Config, host component.Host) (*kafkaE
808872
})
809873
return exp, producer
810874
}
875+
876+
func TestWrapKafkaProducerError(t *testing.T) {
877+
t.Run("should return permanent error on configuration error", func(t *testing.T) {
878+
err := sarama.ConfigurationError("configuration error")
879+
prodErrs := sarama.ProducerErrors{
880+
&sarama.ProducerError{Err: err},
881+
}
882+
883+
got := wrapKafkaProducerError(prodErrs)
884+
885+
assert.True(t, consumererror.IsPermanent(got))
886+
assert.Contains(t, got.Error(), err.Error())
887+
})
888+
889+
t.Run("should return permanent error whne multiple configuration error", func(t *testing.T) {
890+
err := sarama.ConfigurationError("configuration error")
891+
prodErrs := sarama.ProducerErrors{
892+
&sarama.ProducerError{Err: err},
893+
&sarama.ProducerError{Err: err},
894+
}
895+
896+
got := wrapKafkaProducerError(prodErrs)
897+
898+
assert.True(t, consumererror.IsPermanent(got))
899+
assert.Contains(t, got.Error(), err.Error())
900+
})
901+
902+
t.Run("should return not permanent error when at least one not configuration error", func(t *testing.T) {
903+
err := sarama.ConfigurationError("configuration error")
904+
prodErrs := sarama.ProducerErrors{
905+
&sarama.ProducerError{Err: err},
906+
&sarama.ProducerError{Err: errors.New("other producer error")},
907+
}
908+
909+
got := wrapKafkaProducerError(prodErrs)
910+
911+
assert.False(t, consumererror.IsPermanent(got))
912+
assert.Contains(t, got.Error(), err.Error())
913+
})
914+
915+
t.Run("should return not permanent error on other producer error", func(t *testing.T) {
916+
err := errors.New("other producer error")
917+
prodErrs := sarama.ProducerErrors{
918+
&sarama.ProducerError{Err: err},
919+
}
920+
921+
got := wrapKafkaProducerError(prodErrs)
922+
923+
assert.False(t, consumererror.IsPermanent(got))
924+
assert.Contains(t, got.Error(), err.Error())
925+
})
926+
927+
t.Run("should return not permanent error when other error", func(t *testing.T) {
928+
err := errors.New("other error")
929+
930+
got := wrapKafkaProducerError(err)
931+
932+
assert.False(t, consumererror.IsPermanent(got))
933+
assert.Contains(t, got.Error(), err.Error())
934+
})
935+
}

exporter/loadbalancingexporter/example/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24@sha256:30baaea08c5d1e858329c50f29fe381e9b7d7bced11a0f5f1f69a1504cdfbf5e AS build
1+
FROM golang:1.24@sha256:39d9e7d9c5d9c9e4baf0d8fff579f06d5032c0f4425cdec9e86732e8e4e374dc AS build
22

33
WORKDIR /src
44
ADD . /src

internal/datadog/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/aws/aws-sdk-go-v2 v1.36.3
1414
github.com/aws/aws-sdk-go-v2/config v1.29.14
1515
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30
16-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.214.0
16+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.215.0
1717
github.com/cenkalti/backoff/v4 v4.3.0
1818
github.com/google/go-cmp v0.7.0
1919
github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.125.0

0 commit comments

Comments
 (0)