Skip to content

Commit

Permalink
Merge branch 'main' into alpha-solarwindsapmsettingsextension
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrytfleung authored Sep 17, 2024
2 parents 75c0e79 + 3f4dbf1 commit f52277f
Show file tree
Hide file tree
Showing 44 changed files with 541 additions and 109 deletions.
27 changes: 27 additions & 0 deletions .chloggen/codeboten_add-unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: groupbytraceprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Ensure processor_groupbytrace_incomplete_releases metric has a unit.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35221]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
27 changes: 27 additions & 0 deletions .chloggen/kafka-topic-context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: kafkaexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add option to supply destination topic through context.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [34503, 34432]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
22 changes: 22 additions & 0 deletions .chloggen/rm-copies-deltatorateprocessor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: deltatorateprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove unnecessary data copies.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35165]

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
22 changes: 22 additions & 0 deletions .chloggen/rm-copy-transformprocessor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: transformprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove unnecessary data copy when transform sum to/from gauge

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35177]

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ internal/tools/ @open-teleme

pkg/batchperresourceattr/ @open-telemetry/collector-contrib-approvers @atoulme @dmitryax
pkg/batchpersignal/ @open-telemetry/collector-contrib-approvers @jpkrohling
pkg/experimentalmetricmetadata/ @open-telemetry/collector-contrib-approvers @rmfitzpatrick
pkg/datadog/ @open-telemetry/collector-contrib-approvers @mx-psi @dineshg13 @liustanley @songy23 @mackjmr @ankitpatel96
pkg/experimentalmetricmetadata/ @open-telemetry/collector-contrib-approvers @rmfitzpatrick
pkg/golden/ @open-telemetry/collector-contrib-approvers @djaglowski @atoulme
pkg/kafka/topic/ @open-telemetry/collector-contrib-approvers @pavolloffay @MovieStoreGuy
pkg/ottl/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
pkg/pdatatest/ @open-telemetry/collector-contrib-approvers @djaglowski @fatsheep9146
pkg/pdatautil/ @open-telemetry/collector-contrib-approvers @dmitryax
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/kafka/topic
- pkg/ottl
- pkg/pdatatest
- pkg/pdatautil
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/kafka/topic
- pkg/ottl
- pkg/pdatatest
- pkg/pdatautil
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/kafka/topic
- pkg/ottl
- pkg/pdatatest
- pkg/pdatautil
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/kafka/topic
- pkg/ottl
- pkg/pdatatest
- pkg/pdatautil
Expand Down
1 change: 1 addition & 0 deletions cmd/otelcontribcol/builder-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ replaces:
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter => ../../exporter/fileexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => ../../pkg/resourcetotelemetry
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden
- github.com/open-telemetry/opentelemetry-collector-contrib/pkg/kafka/topic => ../../pkg/kafka/topic
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter => ../../exporter/opencensusexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opensearchexporter => ../../exporter/opensearchexporter
- github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => ../../internal/metadataproviders
Expand Down
3 changes: 3 additions & 0 deletions cmd/otelcontribcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.109.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.0.0-00010101000000-000000000000 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.109.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/kafka/topic v0.109.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.109.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.109.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.109.0 // indirect
Expand Down Expand Up @@ -1183,6 +1184,8 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourceto

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden => ../../pkg/golden

replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/kafka/topic => ../../pkg/kafka/topic

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter => ../../exporter/opencensusexporter

replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opensearchexporter => ../../exporter/opensearchexporter
Expand Down
17 changes: 9 additions & 8 deletions exporter/coralogixexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,15 @@ exporters:
Depending on your region, you might need to use a different domain. Here are the available domains:
| Region | Domain |
|---------|---------------------------------|
| USA1 | `coralogix.us` |
| USA2 | `cx498.coralogix.com` |
| APAC1 | `coralogix.in` |
| APAC2 | `coralogixsg.com` |
| EUROPE1 | `coralogix.com` |
| EUROPE2 | `eu2.coralogix.com` |
| Region | Domain |
|---------|-------------------------|
| USA1 | `coralogix.us` |
| USA2 | `cx498.coralogix.com` |
| APAC1 | `coralogix.in` |
| APAC2 | `coralogixsg.com` |
| APAC3 | `ap3.coralogix.com` |
| EUROPE1 | `coralogix.com` |
| EUROPE2 | `eu2.coralogix.com` |

Additionally, Coralogix supports AWS PrivateLink, which provides private connectivity between virtual private clouds (VPCs), supported AWS services, and your on-premises networks without exposing your traffic to the public internet.

Expand Down
3 changes: 2 additions & 1 deletion exporter/dorisexporter/exporter_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog"
Expand Down Expand Up @@ -52,7 +53,7 @@ func TestPushLogData(t *testing.T) {
_, _ = w.Write([]byte(`{"Status":"Success"}`))
})
err = server.ListenAndServe()
require.Equal(t, http.ErrServerClosed, err)
assert.Equal(t, http.ErrServerClosed, err)
}()

err0 := fmt.Errorf("Not Started")
Expand Down
3 changes: 2 additions & 1 deletion exporter/dorisexporter/exporter_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
Expand Down Expand Up @@ -52,7 +53,7 @@ func TestPushTraceData(t *testing.T) {
_, _ = w.Write([]byte(`{"Status":"Success"}`))
})
err = server.ListenAndServe()
require.Equal(t, http.ErrServerClosed, err)
assert.Equal(t, http.ErrServerClosed, err)
}()

err0 := fmt.Errorf("Not Started")
Expand Down
2 changes: 1 addition & 1 deletion exporter/dorisexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func createLogsExporter(ctx context.Context, set exporter.Settings, cfg componen
exporterhelper.WithStart(exporter.start),
exporterhelper.WithShutdown(exporter.shutdown),
// we config the timeout option in http client, so we don't need to set timeout here
exporterhelper.WithTimeout(exporterhelper.TimeoutSettings{Timeout: 0}),
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
exporterhelper.WithQueue(c.QueueSettings),
exporterhelper.WithRetry(c.BackOffConfig),
)
Expand Down
7 changes: 3 additions & 4 deletions exporter/elasticsearchexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ func TestConfig_Validate(t *testing.T) {

for name, tt := range tests {
t.Run(name, func(t *testing.T) {
err := tt.config.Validate()
assert.EqualError(t, err, tt.err)
assert.EqualError(t, component.ValidateConfig(tt.config), tt.err)
})
}
}
Expand All @@ -405,13 +404,13 @@ func TestConfig_Validate_Environment(t *testing.T) {
t.Run("valid", func(t *testing.T) {
t.Setenv("ELASTICSEARCH_URL", "http://test:9200")
config := withDefaultConfig()
err := config.Validate()
err := component.ValidateConfig(config)
require.NoError(t, err)
})
t.Run("invalid", func(t *testing.T) {
t.Setenv("ELASTICSEARCH_URL", "http://valid:9200, *:!")
config := withDefaultConfig()
err := config.Validate()
err := component.ValidateConfig(config)
assert.EqualError(t, err, `invalid endpoint "*:!": parse "*:!": first path segment in URL cannot contain colon`)
})
}
Expand Down
8 changes: 2 additions & 6 deletions exporter/elasticsearchexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ func newExporter(
set exporter.Settings,
index string,
dynamicIndex bool,
) (*elasticsearchExporter, error) {
if err := cfg.Validate(); err != nil {
return nil, err
}

) *elasticsearchExporter {
model := &encodeModel{
dedot: cfg.Mapping.Dedot,
mode: cfg.MappingMode(),
Expand All @@ -72,7 +68,7 @@ func newExporter(
model: model,
logstashFormat: cfg.LogstashFormat,
otel: otel,
}, nil
}
}

func (e *elasticsearchExporter) Start(ctx context.Context, host component.Host) error {
Expand Down
22 changes: 7 additions & 15 deletions exporter/elasticsearchexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package elasticsearchexporter // import "github.com/open-telemetry/opentelemetry

import (
"context"
"fmt"
"net/http"
"time"

Expand Down Expand Up @@ -113,10 +112,7 @@ func createLogsExporter(
}
logConfigDeprecationWarnings(cf, set.Logger)

exporter, err := newExporter(cf, set, index, cf.LogsDynamicIndex.Enabled)
if err != nil {
return nil, fmt.Errorf("cannot configure Elasticsearch exporter: %w", err)
}
exporter := newExporter(cf, set, index, cf.LogsDynamicIndex.Enabled)

return exporterhelper.NewLogsExporter(
ctx,
Expand All @@ -135,10 +131,8 @@ func createMetricsExporter(
cf := cfg.(*Config)
logConfigDeprecationWarnings(cf, set.Logger)

exporter, err := newExporter(cf, set, cf.MetricsIndex, cf.MetricsDynamicIndex.Enabled)
if err != nil {
return nil, fmt.Errorf("cannot configure Elasticsearch exporter: %w", err)
}
exporter := newExporter(cf, set, cf.MetricsIndex, cf.MetricsDynamicIndex.Enabled)

return exporterhelper.NewMetricsExporter(
ctx,
set,
Expand All @@ -150,15 +144,13 @@ func createMetricsExporter(

func createTracesExporter(ctx context.Context,
set exporter.Settings,
cfg component.Config) (exporter.Traces, error) {

cfg component.Config,
) (exporter.Traces, error) {
cf := cfg.(*Config)
logConfigDeprecationWarnings(cf, set.Logger)

exporter, err := newExporter(cf, set, cf.TracesIndex, cf.TracesDynamicIndex.Enabled)
if err != nil {
return nil, fmt.Errorf("cannot configure Elasticsearch exporter: %w", err)
}
exporter := newExporter(cf, set, cf.TracesIndex, cf.TracesDynamicIndex.Enabled)

return exporterhelper.NewTracesExporter(
ctx,
set,
Expand Down
18 changes: 0 additions & 18 deletions exporter/elasticsearchexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ func TestFactory_CreateLogsExporter(t *testing.T) {
require.NoError(t, exporter.Shutdown(context.Background()))
}

func TestFactory_CreateLogsExporter_Fail(t *testing.T) {
factory := NewFactory()
cfg := factory.CreateDefaultConfig()
params := exportertest.NewNopSettings()
_, err := factory.CreateLogsExporter(context.Background(), params, cfg)
require.Error(t, err, "expected an error when creating a logs exporter")
assert.EqualError(t, err, "cannot configure Elasticsearch exporter: exactly one of [endpoint, endpoints, cloudid] must be specified")
}

func TestFactory_CreateMetricsExporter(t *testing.T) {
factory := NewFactory()
cfg := withDefaultConfig(func(cfg *Config) {
Expand All @@ -70,15 +61,6 @@ func TestFactory_CreateTracesExporter(t *testing.T) {
require.NoError(t, exporter.Shutdown(context.Background()))
}

func TestFactory_CreateTracesExporter_Fail(t *testing.T) {
factory := NewFactory()
cfg := factory.CreateDefaultConfig()
params := exportertest.NewNopSettings()
_, err := factory.CreateTracesExporter(context.Background(), params, cfg)
require.Error(t, err, "expected an error when creating a traces exporter")
assert.EqualError(t, err, "cannot configure Elasticsearch exporter: exactly one of [endpoint, endpoints, cloudid] must be specified")
}

func TestFactory_CreateLogsAndTracesExporterWithDeprecatedIndexOption(t *testing.T) {
factory := NewFactory()
cfg := withDefaultConfig(func(cfg *Config) {
Expand Down
4 changes: 4 additions & 0 deletions exporter/fileexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
<!-- end autogenerated section -->

Writes telemetry data to files on disk.

Use the [OTLP JSON File receiver](../../receiver/otlpjsonfilereceiver/README.md) to read the data back into the collector (as long as the data was exported using OTLP JSON format).

Exporter supports the following features:

+ Support for writing pipeline data to a file.
Expand Down
Loading

0 comments on commit f52277f

Please sign in to comment.