Skip to content

Introduce datadogsemanticsprocessor component with mappings for OTLP-… #36918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
4ff43c1
Add feature gate for refactor of OTLP->Datadog span translation
IbraheemA Jan 13, 2025
543adc5
add toversion
IbraheemA Jan 13, 2025
baff387
fix version numbers
IbraheemA Jan 13, 2025
15450cf
Add flag in datadogconnector
IbraheemA Jan 13, 2025
fcce52b
update issue in chlog
IbraheemA Jan 13, 2025
0512659
Merge branch 'main' into add-feature-flag-for-updated-datadog-span-re…
IbraheemA Jan 13, 2025
ca79820
combine exporter and connector flags into one
IbraheemA Jan 14, 2025
8c5d22c
run make commands
IbraheemA Jan 14, 2025
6744b77
update version
IbraheemA Jan 14, 2025
118fe90
Merge branch 'main' into add-feature-flag-for-updated-datadog-span-re…
IbraheemA Jan 14, 2025
d0fb4c2
linter fixes
IbraheemA Jan 15, 2025
85fa614
linter + codeowner fixes
IbraheemA Jan 15, 2025
bce1df7
Merge branch 'main' into add-feature-flag-for-updated-datadog-span-re…
IbraheemA Jan 15, 2025
2d188dd
update generated code
IbraheemA Jan 15, 2025
479a35f
codeowners
IbraheemA Jan 15, 2025
8abed50
fix module version
IbraheemA Jan 15, 2025
2ba7f95
make generate
IbraheemA Jan 15, 2025
a6e06c7
Merge branch 'main' into add-feature-flag-for-updated-datadog-span-re…
IbraheemA Jan 15, 2025
00dbc57
Introduce datadogsemanticsprocessor component with mappings for OTLP-…
IbraheemA Dec 20, 2024
d54723f
modify tests/todo
IbraheemA Dec 20, 2024
1dcf575
Add changelog entry
IbraheemA Dec 20, 2024
cb6cdee
create go.mod for datadogsemanticsprocessor
IbraheemA Jan 7, 2025
ccec5a1
update codeowner
IbraheemA Jan 7, 2025
c58ce3c
typo
IbraheemA Jan 7, 2025
306ad75
make all
IbraheemA Jan 7, 2025
ac283b1
wip
IbraheemA Jan 15, 2025
e7a9235
wip
IbraheemA Jan 15, 2025
e2de3c2
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Jan 15, 2025
c11284d
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 5, 2025
7879002
run make scripts
IbraheemA Feb 5, 2025
2fa1c50
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 5, 2025
7b8b618
remove accidentally committed module
IbraheemA Feb 5, 2025
eff883b
rename datadog.status_code to datadog.http_status_code
IbraheemA Feb 24, 2025
d7d207a
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 24, 2025
7a1aa28
lint
IbraheemA Feb 24, 2025
61d9471
run make
IbraheemA Feb 24, 2025
8b46950
tidylist
IbraheemA Feb 25, 2025
44ce3b0
codeowners
IbraheemA Feb 25, 2025
4cc3f70
run make checks
IbraheemA Feb 25, 2025
d6bd875
fix failing tests
IbraheemA Feb 25, 2025
ee418f2
fix seelog error
IbraheemA Feb 25, 2025
254ae85
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 25, 2025
f62c2ff
ci fixes
IbraheemA Feb 25, 2025
4912d72
update codeowners
IbraheemA Feb 25, 2025
07c0016
update go.mod
IbraheemA Feb 25, 2025
8f690ec
ci fails
IbraheemA Feb 26, 2025
b91648d
typo
IbraheemA Feb 26, 2025
0de93e6
lint
IbraheemA Feb 26, 2025
a30867b
generate
IbraheemA Feb 26, 2025
b9dbd73
tidy
IbraheemA Feb 26, 2025
924a31f
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 26, 2025
2e98b0d
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 26, 2025
9047e80
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Feb 28, 2025
06cb30c
fix typo
IbraheemA Mar 3, 2025
596f71a
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 3, 2025
0fafe8c
go mod update
IbraheemA Mar 3, 2025
abb25d4
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 3, 2025
4e15b2a
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 4, 2025
ae3107f
go mod changes
IbraheemA Mar 4, 2025
d41ef67
gotidy
IbraheemA Mar 4, 2025
4315283
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 4, 2025
4873ecb
go mod
IbraheemA Mar 4, 2025
3cf8514
revert unrelated go.mod changes
IbraheemA Mar 4, 2025
0cc9e7e
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 4, 2025
5b20561
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
mx-psi Mar 5, 2025
7ad32f5
address comment
IbraheemA Mar 5, 2025
1d5e81d
address comments; add host logic
IbraheemA Mar 5, 2025
ed077cb
Address comments
IbraheemA Mar 9, 2025
6fffade
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 10, 2025
e91f2bd
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 11, 2025
3e0a43d
address comments
IbraheemA Mar 11, 2025
94cb655
checks
IbraheemA Mar 11, 2025
857c132
Merge branch 'main' into ibraheem/traces-only-dd-semantic-processor
IbraheemA Mar 12, 2025
9c81d35
lint
IbraheemA Mar 12, 2025
ffddc6c
modules
IbraheemA Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .chloggen/ibraheem_traces-only-dd-semantic-processor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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: datadogsemanticsprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add datadogsemanticsprocessor, which transforms OpenTelemetry semantic conventions to Datadog semantic conventions

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [35304]
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ pkg/xk8stest/ @open-telemetry
processor/attributesprocessor/ @open-telemetry/collector-contrib-approvers @boostchicken
processor/coralogixprocessor/ @open-telemetry/collector-contrib-approvers @crobert-1 @povilasv
processor/cumulativetodeltaprocessor/ @open-telemetry/collector-contrib-approvers @TylerHelmuth
processor/datadogsemanticsprocessor/ @open-telemetry/collector-contrib-approvers @songy23 @IbraheemA @mx-psi @dineshg13 @ankitpatel96 @jade-guiton-dd @jackgopack4
processor/deltatocumulativeprocessor/ @open-telemetry/collector-contrib-approvers @sh0rez @RichieSams
processor/deltatorateprocessor/ @open-telemetry/collector-contrib-approvers @Aneurysm9
processor/filterprocessor/ @open-telemetry/collector-contrib-approvers @TylerHelmuth @boostchicken
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 @@ -182,6 +182,7 @@ body:
- processor/attributes
- processor/coralogix
- processor/cumulativetodelta
- processor/datadogsemantics
- processor/deltatocumulative
- processor/deltatorate
- processor/filter
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 @@ -176,6 +176,7 @@ body:
- processor/attributes
- processor/coralogix
- processor/cumulativetodelta
- processor/datadogsemantics
- processor/deltatocumulative
- processor/deltatorate
- processor/filter
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 @@ -176,6 +176,7 @@ body:
- processor/attributes
- processor/coralogix
- processor/cumulativetodelta
- processor/datadogsemantics
- processor/deltatocumulative
- processor/deltatorate
- processor/filter
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 @@ -181,6 +181,7 @@ body:
- processor/attributes
- processor/coralogix
- processor/cumulativetodelta
- processor/datadogsemantics
- processor/deltatocumulative
- processor/deltatorate
- processor/filter
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 @@ -133,6 +133,7 @@ processors:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.121.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.121.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/remotetapprocessor v0.121.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogsemanticsprocessor v0.121.1

receivers:
- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.121.1-0.20250307194215-7d3e03e500b0
Expand Down
1 change: 1 addition & 0 deletions internal/tidylist/tidylist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pkg/winperfcounters
processor/attributesprocessor
processor/coralogixprocessor
processor/cumulativetodeltaprocessor
processor/datadogsemanticsprocessor
processor/deltatocumulativeprocessor
processor/deltatorateprocessor
processor/filterprocessor
Expand Down
1 change: 1 addition & 0 deletions processor/datadogsemanticsprocessor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ../../Makefile.Common
12 changes: 12 additions & 0 deletions processor/datadogsemanticsprocessor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Datadog Semantics Processor
<!-- status autogenerated section -->
| Status | |
| ------------- |-----------|
| Stability | [development]: traces |
| Distributions | [contrib] |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Fdatadogsemantics%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fdatadogsemantics) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fdatadogsemantics%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fdatadogsemantics) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@songy23](https://www.github.com/songy23), [@IbraheemA](https://www.github.com/IbraheemA), [@mx-psi](https://www.github.com/mx-psi), [@dineshg13](https://www.github.com/dineshg13), [@ankitpatel96](https://www.github.com/ankitpatel96), [@jade-guiton-dd](https://www.github.com/jade-guiton-dd), [@jackgopack4](https://www.github.com/jackgopack4) |

[development]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#development
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
<!-- end autogenerated section -->
13 changes: 13 additions & 0 deletions processor/datadogsemanticsprocessor/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package datadogsemanticsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogsemanticsprocessor"

// Config defines configuration for Datadog semantics processor.
type Config struct {
// OverrideIncomingDatadogFields specifies what is done with incoming Datadog fields.
// If it is false, any fields namespaced with "datadog." will pass through unchanged.
// If it is true, all fields in the "datadog." namespace will be recomputed by the processor.
// Default: false.
OverrideIncomingDatadogFields bool `mapstructure:"override_incoming_datadog_fields"`
}
7 changes: 7 additions & 0 deletions processor/datadogsemanticsprocessor/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

//go:generate mdatagen metadata.yaml

// Package datadogsemanticsprocessor contains the logic to transform OpenTelemetry semantic conventions to Datadog semantic conventions.
package datadogsemanticsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogsemanticsprocessor"
73 changes: 73 additions & 0 deletions processor/datadogsemanticsprocessor/factory.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package datadogsemanticsprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogsemanticsprocessor"

import (
"context"

"github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorhelper"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/datadogsemanticsprocessor/internal/metadata"
)

var consumerCapabilities = consumer.Capabilities{MutatesData: true}

// NewFactory returns a new factory for the Datadog semantics processor.
func NewFactory() processor.Factory {
return processor.NewFactory(
metadata.Type,
createDefaultConfig,
processor.WithTraces(createTracesProcessor, metadata.TracesStability),
)
}

type tracesProcessor struct {
overrideIncomingDatadogFields bool
attrsTranslator *attributes.Translator
}

func newTracesProcessor(
set processor.Settings,
cfg *Config,
) (*tracesProcessor, error) {
attrsTranslator, err := attributes.NewTranslator(set.TelemetrySettings)
if err != nil {
return nil, err
}
return &tracesProcessor{
overrideIncomingDatadogFields: cfg.OverrideIncomingDatadogFields,
attrsTranslator: attrsTranslator,
}, nil
}

func createDefaultConfig() component.Config {
return &Config{
OverrideIncomingDatadogFields: false,
}
}

func createTracesProcessor(
ctx context.Context,
set processor.Settings,
cfg component.Config,
next consumer.Traces,
) (processor.Traces, error) {
oCfg := cfg.(*Config)
tp, err := newTracesProcessor(set, oCfg)
if err != nil {
return nil, err
}
return processorhelper.NewTraces(
ctx,
set,
cfg,
next,
tp.processTraces,
processorhelper.WithCapabilities(consumerCapabilities),
)
}
137 changes: 137 additions & 0 deletions processor/datadogsemanticsprocessor/generated_component_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions processor/datadogsemanticsprocessor/generated_package_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading