Skip to content

Commit dc08418

Browse files
authored
Merge branch 'open-telemetry:main' into add-aws-http-error-event
2 parents d0f2f34 + cbe5e71 commit dc08418

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

+957
-133
lines changed

.chloggen/awscwl_noisypusher.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: awscloudwatchlogsexporter/awsemfexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Reduce noisy logs emitted by CloudWatch Logs Pusher.
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: [27774]
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: The Collector logger will now write successful CloudWatch API writes at the Debug level instead of Info level.
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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: k8sobjectsreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Move k8sobjectsreceiver from Alpha stability to Beta stability for logs.
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: [27635]
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: []
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: datadogconnector
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Allow datadogconnector to be used as a traces-to-traces connector
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: [27846]
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/double-converter.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: doubleconverter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Adding a double converter into pkg/ottl"
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: [22056]
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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: filelogreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add a new "top_n" option to specify the number of files to track when using ordering criteria
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: [23788]
14+
15+
# If your change doesn't affect end users or the exported elements of any package,
16+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
17+
# Optional: The change log or logs in which this entry should be included.
18+
# e.g. '[user]' or '[user, api]'
19+
# Include 'user' if the change is relevant to end users.
20+
# Include 'api' if there is a change to a library API.
21+
# Default: '[user]'
22+
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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: pkg/pdatatest
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "support ignore span ID in span comparisons for ptracetest"
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: [27685]
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: []
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/pdatatest
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "support ignore trace ID in span comparisons for ptracetest"
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: [27687]
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: []
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/stanza
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: When async is enabled for udp receiver, separate logic into readers (only read logs from udp port and push to channel), and processors (read logs from channel and process; decode, split, add attributes, and push downstream), allowing to change concurrency level for both readers and processors separately.
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: [27613]
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: []

cmd/otelcontribcol/exporters_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,23 @@ func verifyExporterLifecycle(t *testing.T, factory exporter.Factory, getConfigFn
606606
assert.NotPanics(t, func() {
607607
switch e := exp.(type) {
608608
case exporter.Logs:
609-
err = e.ConsumeLogs(ctx, testdata.GenerateLogsManyLogRecordsSameResource(2))
609+
logs := testdata.GenerateLogsManyLogRecordsSameResource(2)
610+
if !e.Capabilities().MutatesData {
611+
logs.MarkReadOnly()
612+
}
613+
err = e.ConsumeLogs(ctx, logs)
610614
case exporter.Metrics:
611-
err = e.ConsumeMetrics(ctx, testdata.GenerateMetricsTwoMetrics())
615+
metrics := testdata.GenerateMetricsTwoMetrics()
616+
if !e.Capabilities().MutatesData {
617+
metrics.MarkReadOnly()
618+
}
619+
err = e.ConsumeMetrics(ctx, metrics)
612620
case exporter.Traces:
613-
err = e.ConsumeTraces(ctx, testdata.GenerateTracesTwoSpansSameResource())
621+
traces := testdata.GenerateTracesTwoSpansSameResource()
622+
if !e.Capabilities().MutatesData {
623+
traces.MarkReadOnly()
624+
}
625+
err = e.ConsumeTraces(ctx, traces)
614626
}
615627
})
616628
if !expectErr {

connector/datadogconnector/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| [Exporter Pipeline Type] | [Receiver Pipeline Type] | [Stability Level] |
1616
| ------------------------ | ------------------------ | ----------------- |
1717
| traces | metrics | [beta] |
18+
| traces | traces | [beta] |
1819

1920
[Exporter Pipeline Type]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md#exporter-pipeline-type
2021
[Receiver Pipeline Type]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/connector/README.md#receiver-pipeline-type
@@ -91,7 +92,7 @@ service:
9192
exporters: [datadog/connector]
9293

9394
traces/2: # this pipeline uses sampling
94-
receivers: [otlp]
95+
receivers: [datadog/connector]
9596
processors: [batch, probabilistic_sampler]
9697
exporters: [datadog]
9798

connector/datadogconnector/connector.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818

1919
// connectorImp is the schema for connector
2020
type connectorImp struct {
21-
metricsConsumer consumer.Metrics // the next component in the pipeline to ingest data after connector
21+
metricsConsumer consumer.Metrics // the next component in the pipeline to ingest metrics after connector
22+
tracesConsumer consumer.Traces // the next component in the pipeline to ingest traces after connector
2223
logger *zap.Logger
2324

2425
// agent specifies the agent used to ingest traces and output APM Stats.
@@ -40,7 +41,7 @@ type connectorImp struct {
4041
var _ component.Component = (*connectorImp)(nil) // testing that the connectorImp properly implements the type Component interface
4142

4243
// function to create a new connector
43-
func newConnector(logger *zap.Logger, _ component.Config, nextConsumer consumer.Metrics) (*connectorImp, error) {
44+
func newConnector(logger *zap.Logger, _ component.Config, metricsConsumer consumer.Metrics, tracesConsumer consumer.Traces) (*connectorImp, error) {
4445
logger.Info("Building datadog connector")
4546

4647
in := make(chan *pb.StatsPayload, 100)
@@ -55,7 +56,8 @@ func newConnector(logger *zap.Logger, _ component.Config, nextConsumer consumer.
5556
agent: datadog.NewAgent(ctx, in),
5657
translator: trans,
5758
in: in,
58-
metricsConsumer: nextConsumer,
59+
metricsConsumer: metricsConsumer,
60+
tracesConsumer: tracesConsumer,
5961
exit: make(chan struct{}),
6062
}, nil
6163
}
@@ -64,7 +66,9 @@ func newConnector(logger *zap.Logger, _ component.Config, nextConsumer consumer.
6466
func (c *connectorImp) Start(_ context.Context, _ component.Host) error {
6567
c.logger.Info("Starting datadogconnector")
6668
c.agent.Start()
67-
go c.run()
69+
if c.metricsConsumer != nil {
70+
go c.run()
71+
}
6872
return nil
6973
}
7074

@@ -85,6 +89,9 @@ func (c *connectorImp) Capabilities() consumer.Capabilities {
8589

8690
func (c *connectorImp) ConsumeTraces(ctx context.Context, traces ptrace.Traces) error {
8791
c.agent.Ingest(ctx, traces)
92+
if c.tracesConsumer != nil {
93+
return c.tracesConsumer.ConsumeTraces(ctx, traces)
94+
}
8895
return nil
8996
}
9097

connector/datadogconnector/connector_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ func TestNewConnector(t *testing.T) {
2323
creationParams := connectortest.NewNopCreateSettings()
2424
cfg := factory.CreateDefaultConfig().(*Config)
2525

26-
traceConnector, err := factory.CreateTracesToMetrics(context.Background(), creationParams, cfg, consumertest.NewNop())
26+
traceToMetricsConnector, err := factory.CreateTracesToMetrics(context.Background(), creationParams, cfg, consumertest.NewNop())
2727
assert.NoError(t, err)
2828

29-
_, ok := traceConnector.(*connectorImp)
29+
_, ok := traceToMetricsConnector.(*connectorImp)
30+
assert.True(t, ok) // checks if the created connector implements the connectorImp struct
31+
32+
traceToTracesConnector, err := factory.CreateTracesToTraces(context.Background(), creationParams, cfg, consumertest.NewNop())
33+
assert.NoError(t, err)
34+
35+
_, ok = traceToTracesConnector.(*connectorImp)
3036
assert.True(t, ok) // checks if the created connector implements the connectorImp struct
3137
}

connector/datadogconnector/factory.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ func NewFactory() connector.Factory {
2121
return connector.NewFactory(
2222
metadata.Type,
2323
createDefaultConfig,
24-
connector.WithTracesToMetrics(createTracesToMetricsConnector, metadata.TracesToMetricsStability))
24+
connector.WithTracesToMetrics(createTracesToMetricsConnector, metadata.TracesToMetricsStability),
25+
connector.WithTracesToTraces(createTracesToTracesConnector, metadata.TracesToTracesStability))
2526
}
2627

2728
var _ component.Config = (*Config)(nil)
@@ -35,7 +36,15 @@ func createDefaultConfig() component.Config {
3536
// defines the consumer type of the connector
3637
// we want to consume traces and export metrics therefore define nextConsumer as metrics, consumer is the next component in the pipeline
3738
func createTracesToMetricsConnector(_ context.Context, params connector.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (connector.Traces, error) {
38-
c, err := newConnector(params.Logger, cfg, nextConsumer)
39+
c, err := newConnector(params.Logger, cfg, nextConsumer, nil)
40+
if err != nil {
41+
return nil, err
42+
}
43+
return c, nil
44+
}
45+
46+
func createTracesToTracesConnector(_ context.Context, params connector.CreateSettings, cfg component.Config, nextConsumer consumer.Traces) (connector.Traces, error) {
47+
c, err := newConnector(params.Logger, cfg, nil, nextConsumer)
3948
if err != nil {
4049
return nil, err
4150
}

connector/datadogconnector/internal/metadata/generated_status.go

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

connector/datadogconnector/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: datadog
33
status:
44
class: connector
55
stability:
6-
beta: [traces_to_metrics]
6+
beta: [traces_to_metrics, traces_to_traces]
77
distributions: [contrib]
88
codeowners:
99
active: [mx-psi, gbbr, dineshg13]

exporter/elasticsearchexporter/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ require (
1616
go.opentelemetry.io/collector/exporter v0.87.1-0.20231017160804-ec0725874313
1717
go.opentelemetry.io/collector/pdata v1.0.0-rcv0016.0.20231017160804-ec0725874313
1818
go.opentelemetry.io/collector/semconv v0.87.1-0.20231017160804-ec0725874313
19-
go.uber.org/multierr v1.11.0
2019
go.uber.org/zap v1.26.0
2120
)
2221

@@ -44,6 +43,7 @@ require (
4443
go.opentelemetry.io/otel v1.19.0 // indirect
4544
go.opentelemetry.io/otel/metric v1.19.0 // indirect
4645
go.opentelemetry.io/otel/trace v1.19.0 // indirect
46+
go.uber.org/multierr v1.11.0 // indirect
4747
golang.org/x/net v0.17.0 // indirect
4848
golang.org/x/sys v0.13.0 // indirect
4949
golang.org/x/text v0.13.0 // indirect

0 commit comments

Comments
 (0)