Skip to content

Commit

Permalink
Merge branch 'main' into move-attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
odubajDT authored Sep 17, 2024
2 parents 36cb58f + 7e8ebd7 commit f9667c0
Show file tree
Hide file tree
Showing 98 changed files with 1,102 additions and 431 deletions.
27 changes: 27 additions & 0 deletions .chloggen/cpu_stepping_fg_stable.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Move `processor.resourcedetection.hostCPUSteppingAsString` feature gate to stable.

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

# (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/doris-logs.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: new_component

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

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

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

# (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: [user]
13 changes: 13 additions & 0 deletions .chloggen/munir_add-option-to-avoid-remapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
change_type: enhancement

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Adds exporter.datadogexporter.metricremappingdisabled featuregate which disables renaming OpenTelemetry metrics to match Datadog semantics. This feature gate is only for internal use."

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

# Optional: A list of users who contributed to the change. This is used to generate the list of contributors in the changelog.
change_logs: []
29 changes: 29 additions & 0 deletions .chloggen/otlp_logs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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: kafkareceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Add support for `otlp_json` encoding to Kafka receiver. The payload is deserialized into OpenTelemetry traces using JSON format."

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

# (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: |
This encoding allows the Kafka receiver to handle trace data in JSON format,
enabling integration with systems that export traces as JSON-encoded data.
# 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]
27 changes: 27 additions & 0 deletions .chloggen/remove_host_cpu_model_family_fg.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: breaking

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

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove `processor.resourcedetection.hostCPUModelAndFamilyAsString` feature gate.

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

# (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: []
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]
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ 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/ottl/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
pkg/pdatatest/ @open-telemetry/collector-contrib-approvers @djaglowski @fatsheep9146
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/ottl
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/ottl
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/ottl
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ body:
- internal/tools
- pkg/batchperresourceattr
- pkg/batchpersignal
- pkg/datadog
- pkg/experimentalmetricmetadata
- pkg/golden
- pkg/ottl
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
- name: Ensure required ports in the dynamic range are available
run: |
& ${{ github.workspace }}\.github\workflows\scripts\win-required-ports.ps1
- name: Build shared test tools
# If component tests share Makefile targets they need to be added here to avoid
# concurrent component tests clashing when building such targets. This applies
# specifically to Windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/34691
run: make "$(${PWD} -replace '\\', '/')/.tools/gotestsum"
- name: Run Unit tests
run: make -j2 gotest GROUP=${{ matrix.group }}
windows-unittest:
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ linters-settings:
disable:
- float-compare
- formatter
- go-require
- require-error
- suite-subtest-run
- useless-assert
Expand Down
2 changes: 1 addition & 1 deletion Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ GOTESTSUM := $(TOOLS_BIN_DIR)/gotestsum
TESTIFYLINT := $(TOOLS_BIN_DIR)/testifylint

GOTESTSUM_OPT?= --rerun-fails=1
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,formatter,go-require,require-error,suite-subtest-run,useless-assert
TESTIFYLINT_OPT?= --enable-all --disable=float-compare,formatter,require-error,suite-subtest-run,useless-assert

# BUILD_TYPE should be one of (dev, release).
BUILD_TYPE?=release
Expand Down
3 changes: 2 additions & 1 deletion cmd/telemetrygen/internal/e2etest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
Expand Down Expand Up @@ -53,7 +54,7 @@ func TestGenerateTraces(t *testing.T) {
}
go func() {
err = traces.Start(cfg)
require.NoError(t, err)
assert.NoError(t, err)
}()
require.Eventually(t, func() bool {
return len(sink.AllTraces()) > 0
Expand Down
2 changes: 1 addition & 1 deletion connector/spanmetricsconnector/connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ func TestConcurrentShutdown(t *testing.T) {
for i := 0; i < concurrency; i++ {
go func() {
err := p.Shutdown(ctx)
require.NoError(t, err)
assert.NoError(t, err)
wg.Done()
}()
}
Expand Down
8 changes: 4 additions & 4 deletions exporter/carbonexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestConsumeMetrics(t *testing.T) {
defer writersWG.Done()
<-startCh
for j := 0; j < tt.writesPerProducer; j++ {
require.NoError(t, exp.ConsumeMetrics(context.Background(), tt.md))
assert.NoError(t, exp.ConsumeMetrics(context.Background(), tt.md))
}
}()
}
Expand Down Expand Up @@ -332,10 +332,10 @@ func (cs *carbonServer) start(t *testing.T, numExpectedReq int) {
// Close is expected to cause error.
return
}
require.NoError(t, err)
assert.NoError(t, err)
go func(conn net.Conn) {
defer func() {
require.NoError(t, conn.Close())
assert.NoError(t, conn.Close())
}()

reader := bufio.NewReader(conn)
Expand All @@ -344,7 +344,7 @@ func (cs *carbonServer) start(t *testing.T, numExpectedReq int) {
if errors.Is(err, io.EOF) {
return
}
require.NoError(t, err)
assert.NoError(t, err)

if cs.expectedContainsValue != "" {
assert.Contains(t, string(buf), cs.expectedContainsValue)
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
12 changes: 12 additions & 0 deletions exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ var metricExportNativeClientFeatureGate = featuregate.GlobalRegistry().MustRegis
featuregate.WithRegisterDescription("When enabled, metric export in datadogexporter uses native Datadog client APIs instead of Zorkian APIs."),
)

var metricRemappingDisableddFeatureGate = featuregate.GlobalRegistry().MustRegister(
"exporter.datadogexporter.metricremappingdisabled",
featuregate.StageAlpha,
featuregate.WithRegisterDescription("When enabled the Datadog Exporter remaps OpenTelemetry semantic conventions to Datadog semantic conventions. This feature gate is only for internal use."),
featuregate.WithRegisterReferenceURL("https://docs.datadoghq.com/opentelemetry/schema_semantics/metrics_mapping/"),
)

// noAPMStatsFeatureGate causes the trace consumer to skip APM stats computation.
var noAPMStatsFeatureGate = featuregate.GlobalRegistry().MustRegister(
"exporter.datadogexporter.DisableAPMStats",
Expand All @@ -65,6 +72,11 @@ func isMetricExportV2Enabled() bool {
return metricExportNativeClientFeatureGate.IsEnabled()
}

// isMetricRemappingDisabled returns true if the datadogexporter should generate Datadog-compliant metrics from OpenTelemetry metrics
func isMetricRemappingDisabled() bool {
return metricRemappingDisableddFeatureGate.IsEnabled()
}

func isLogsAgentExporterEnabled() bool {
return logsAgentExporterFeatureGate.IsEnabled()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ func TestPushMetadata(t *testing.T) {
assert.Equal(t, "apikey", r.Header.Get("DD-Api-Key"))
assert.Equal(t, "otelcontribcol/1.0", r.Header.Get("User-Agent"))
reader, err := gzip.NewReader(r.Body)
require.NoError(t, err)
assert.NoError(t, err)
body, err := io.ReadAll(reader)
require.NoError(t, err)
assert.NoError(t, err)

var recvMetadata payload.HostMetadata
err = json.Unmarshal(body, &recvMetadata)
require.NoError(t, err)
assert.NoError(t, err)
assert.Equal(t, mockMetadata, recvMetadata)
})

Expand Down
7 changes: 6 additions & 1 deletion exporter/datadogexporter/metrics_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ func translatorFromConfig(set component.TelemetrySettings, cfg *Config, attrsTra
options := []otlpmetrics.TranslatorOption{
otlpmetrics.WithDeltaTTL(cfg.Metrics.DeltaTTL),
otlpmetrics.WithFallbackSourceProvider(sourceProvider),
otlpmetrics.WithRemapping(),
}

if isMetricRemappingDisabled() {
set.Logger.Warn("Metric remapping is disabled in the Datadog exporter. OpenTelemetry metrics must be mapped to Datadog semantics before metrics are exported to Datadog (ex: via a processor).")
} else {
options = append(options, otlpmetrics.WithRemapping())
}

if cfg.Metrics.HistConfig.SendAggregations {
Expand Down
Loading

0 comments on commit f9667c0

Please sign in to comment.