Skip to content

Commit c4a9434

Browse files
committed
Merge remote-tracking branch 'upstream/main' into transformprocessor-profiles-basic
2 parents a552780 + de465d2 commit c4a9434

Some content is hidden

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

53 files changed

+1073
-206
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: 'enhancement'
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: datadogexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Improve accuracy of conversion for single-point exponential histograms
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: [40867]
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: bug_fix
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: Use proper syncronization to fix a collector panic when an error occurs
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: [40845]
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/os-dynamic-index.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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: "opensearchexporter"
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Add support for dynamic log indexing in OpenSearch exporter"
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: [34746, 38595]
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+
- This feature allows users to specify dynamic log indices based on attributes.
20+
- It supports time-based index name formatting and fallback options.
21+
22+
# If your change doesn't affect end users or the exported elements of any package,
23+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
24+
# Optional: The change log or logs in which this entry should be included.
25+
# e.g. '[user]' or '[user, api]'
26+
# Include 'user' if the change is relevant to end users.
27+
# Include 'api' if there is a change to a library API.
28+
# Default: '[user]'
29+
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/ottl
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add accessors for profile attributes
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: [39681]
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: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: processor/transform
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Introduce optional metric name suffix setup for metric conversion functions"
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: [33850]
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 affected functions are: convert_summary_count_val_to_sum(), convert_summary_sum_val_to_sum(), extract_count_metric(), extract_sum_metric()"
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: []

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ processor/tailsamplingprocessor/ @open-telemetry
213213
processor/transformprocessor/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @evan-bradley @edmocosta
214214
receiver/activedirectorydsreceiver/ @open-telemetry/collector-contrib-approvers @pjanotti
215215
receiver/aerospikereceiver/ @open-telemetry/collector-contrib-approvers @antonblock
216-
receiver/apachereceiver/ @open-telemetry/collector-contrib-approvers @colelaven
216+
receiver/apachereceiver/ @open-telemetry/collector-contrib-approvers @colelaven @ishleenk17
217217
receiver/apachesparkreceiver/ @open-telemetry/collector-contrib-approvers @Caleb-Hurshman @mrsillydog
218218
receiver/awscloudwatchreceiver/ @open-telemetry/collector-contrib-approvers @schmikei
219219
receiver/awscontainerinsightreceiver/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @pxaws
@@ -280,7 +280,7 @@ receiver/mongodbreceiver/ @open-telemetry
280280
receiver/mysqlreceiver/ @open-telemetry/collector-contrib-approvers @antonblock
281281
receiver/namedpipereceiver/ @open-telemetry/collector-contrib-approvers @sinkingpoint
282282
receiver/netflowreceiver/ @open-telemetry/collector-contrib-approvers @evan-bradley @dlopes7
283-
receiver/nginxreceiver/ @open-telemetry/collector-contrib-approvers @colelaven
283+
receiver/nginxreceiver/ @open-telemetry/collector-contrib-approvers @colelaven @ishleenk17
284284
receiver/nsxtreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @schmikei
285285
receiver/ntpreceiver/ @open-telemetry/collector-contrib-approvers @atoulme
286286
receiver/opencensusreceiver/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers

connector/datadogconnector/connector_native.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package datadogconnector // import "github.com/open-telemetry/opentelemetry-coll
66
import (
77
"context"
88
"fmt"
9+
"sync"
910
"time"
1011

1112
"github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor"
@@ -29,6 +30,8 @@ type traceToMetricConnectorNative struct {
2930
metricsConsumer consumer.Metrics // the next component in the pipeline to ingest metrics after connector
3031
logger *zap.Logger
3132

33+
wg sync.WaitGroup
34+
3235
// concentrator ingests spans and produces APM stats
3336
concentrator *stats.Concentrator
3437

@@ -100,6 +103,7 @@ func newTraceToMetricConnectorNative(set component.TelemetrySettings, cfg compon
100103
func (c *traceToMetricConnectorNative) Start(_ context.Context, _ component.Host) error {
101104
c.logger.Info("Starting datadogconnector")
102105
c.concentrator.Start()
106+
c.wg.Add(1)
103107
go c.run()
104108
c.isStarted = true
105109
return nil
@@ -117,8 +121,8 @@ func (c *traceToMetricConnectorNative) Shutdown(context.Context) error {
117121
// stop the obfuscator and concentrator and wait for the run loop to exit
118122
c.obfuscator.Stop()
119123
c.concentrator.Stop()
120-
c.exit <- struct{}{} // signal exit
121-
<-c.exit // wait for close
124+
close(c.exit)
125+
c.wg.Wait()
122126
return nil
123127
}
124128

@@ -139,7 +143,7 @@ func (c *traceToMetricConnectorNative) ConsumeTraces(_ context.Context, traces p
139143
// run awaits incoming stats resulting from the agent's ingestion, converts them
140144
// to metrics and flushes them using the configured metrics exporter.
141145
func (c *traceToMetricConnectorNative) run() {
142-
defer close(c.exit)
146+
defer c.wg.Done()
143147
for {
144148
select {
145149
case stats := <-c.statsout:

connector/datadogconnector/connector_native_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package datadogconnector
55

66
import (
77
"context"
8+
"errors"
89
"sort"
910
"testing"
1011
"time"
@@ -357,3 +358,18 @@ func TestObfuscate(t *testing.T) {
357358
t.Errorf("Diff between APM stats -want +got:\n%v", diff)
358359
}
359360
}
361+
362+
func TestNoPanic(t *testing.T) {
363+
c, _ := creteConnectorNative(t)
364+
c.metricsConsumer = consumertest.NewErr(errors.New("error"))
365+
require.NoError(t, c.Start(context.Background(), componenttest.NewNopHost()))
366+
trace1 := generateTrace()
367+
368+
err := c.ConsumeTraces(context.Background(), trace1)
369+
assert.NoError(t, err)
370+
371+
time.Sleep(2 * time.Second)
372+
373+
err = c.Shutdown(context.Background())
374+
require.NoError(t, err)
375+
}

connector/datadogconnector/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ require (
99
github.com/DataDog/datadog-agent/pkg/proto v0.68.0-rc.3
1010
github.com/DataDog/datadog-agent/pkg/trace v0.66.1
1111
github.com/DataDog/datadog-go/v5 v5.6.0
12-
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.28.0
13-
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.28.0
12+
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.29.0
13+
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.29.0
1414
github.com/google/go-cmp v0.7.0
1515
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.128.0
1616
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.128.0
@@ -130,9 +130,9 @@ require (
130130
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
131131
github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee // indirect
132132
github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect
133-
github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.28.0 // indirect
134-
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.28.0 // indirect
135-
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.28.0 // indirect
133+
github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.29.0 // indirect
134+
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.29.0 // indirect
135+
github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.29.0 // indirect
136136
github.com/DataDog/sketches-go v1.4.7 // indirect
137137
github.com/DataDog/viper v1.14.0 // indirect
138138
github.com/DataDog/zstd v1.5.6 // indirect

connector/datadogconnector/go.sum

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

0 commit comments

Comments
 (0)