Skip to content

Support OTLP logs configuration #1703

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ IMG ?= gcr.io/datadoghq/operator:$(IMG_VERSION)
IMG_CHECK ?= gcr.io/datadoghq/operator-check:latest

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24
ENVTEST_K8S_VERSION = 1.30

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
17 changes: 14 additions & 3 deletions api/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ type DogstatsdFeatureConfig struct {
type OTLPFeatureConfig struct {
// Receiver contains configuration for the OTLP ingest receiver.
Receiver OTLPReceiverConfig `json:"receiver,omitempty"`
// Logs contains configuration for the OTLP ingest logs.
Logs OTLPLogsConfig `json:"logs,omitempty"`
}

// OTLPReceiverConfig contains configuration for the OTLP ingest receiver.
Expand Down Expand Up @@ -624,6 +626,15 @@ type OTLPHTTPConfig struct {
Endpoint *string `json:"endpoint,omitempty"`
}

// OTLPLogsConfig contains configuration for the OTLP ingest logs.
// +k8s:openapi-gen=true
type OTLPLogsConfig struct {
// Enable logs support in the OTLP ingest endpoint.
// Default: false
// +optional
Enabled *bool `json:"enabled,omitempty"`
}

// EventCollectionFeatureConfig contains the Event Collection configuration.
// +k8s:openapi-gen=true
type EventCollectionFeatureConfig struct {
Expand Down Expand Up @@ -1307,7 +1318,7 @@ type GlobalConfig struct {
// +listType=set
Tags []string `json:"tags,omitempty"`

//Env contains a list of environment variables that are set for all Agents.
// Env contains a list of environment variables that are set for all Agents.
// +optional
// +listType=map
// +listMapKey=name
Expand Down Expand Up @@ -1693,7 +1704,7 @@ type DatadogAgentComponentOverride struct {
// +k8s:openapi-gen=true
type DatadogAgentGenericContainer struct {
// Name of the container that is overridden
//+optional
// +optional
Name *string `json:"name,omitempty"`

// LogLevel sets logging verbosity (overrides global setting).
Expand Down Expand Up @@ -1859,7 +1870,7 @@ type DatadogAgent struct {
Status DatadogAgentStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
// +kubebuilder:object:root=true

// DatadogAgentList contains a list of DatadogAgent.
type DatadogAgentList struct {
Expand Down
21 changes: 21 additions & 0 deletions api/datadoghq/v2alpha1/zz_generated.deepcopy.go

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

30 changes: 29 additions & 1 deletion api/datadoghq/v2alpha1/zz_generated.openapi.go

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

18 changes: 18 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,15 @@ spec:
otlp:
description: OTLP ingest configuration
properties:
logs:
description: Logs contains configuration for the OTLP ingest logs.
properties:
enabled:
description: |-
Enable logs support in the OTLP ingest endpoint.
Default: false
type: boolean
type: object
receiver:
description: Receiver contains configuration for the OTLP ingest receiver.
properties:
Expand Down Expand Up @@ -8333,6 +8342,15 @@ spec:
otlp:
description: OTLP ingest configuration
properties:
logs:
description: Logs contains configuration for the OTLP ingest logs.
properties:
enabled:
description: |-
Enable logs support in the OTLP ingest endpoint.
Default: false
type: boolean
type: object
receiver:
description: Receiver contains configuration for the OTLP ingest receiver.
properties:
Expand Down
22 changes: 22 additions & 0 deletions config/crd/bases/v1/datadoghq.com_datadogagents_v2alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,17 @@
"additionalProperties": false,
"description": "OTLP ingest configuration",
"properties": {
"logs": {
"additionalProperties": false,
"description": "Logs contains configuration for the OTLP ingest logs.",
"properties": {
"enabled": {
"description": "Enable logs support in the OTLP ingest endpoint.\nDefault: false",
"type": "boolean"
}
},
"type": "object"
},
"receiver": {
"additionalProperties": false,
"description": "Receiver contains configuration for the OTLP ingest receiver.",
Expand Down Expand Up @@ -8329,6 +8340,17 @@
"additionalProperties": false,
"description": "OTLP ingest configuration",
"properties": {
"logs": {
"additionalProperties": false,
"description": "Logs contains configuration for the OTLP ingest logs.",
"properties": {
"enabled": {
"description": "Enable logs support in the OTLP ingest endpoint.\nDefault: false",
"type": "boolean"
}
},
"type": "object"
},
"receiver": {
"additionalProperties": false,
"description": "Receiver contains configuration for the OTLP ingest receiver.",
Expand Down
1 change: 1 addition & 0 deletions docs/configuration.v2alpha1.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ spec:
| features.otelCollector.coreConfig.extensionURL | Extension URL provides the URL of the ddflareextension to the core agent. |
| features.otelCollector.enabled | Enables the OTel Agent. Default: true |
| features.otelCollector.ports | Contains the ports for the otel-agent. Defaults: otel-grpc:4317 / otel-http:4318. Note: setting 4317 or 4318 manually is *only* supported if name match default names (otel-grpc, otel-http). If not, this will lead to a port conflict. This limitation will be lifted once annotations support is removed. |
| features.otlp.logs.enabled | Enable logs support in the OTLP ingest endpoint. Default: false |
| features.otlp.receiver.protocols.grpc.enabled | Enable the OTLP/gRPC endpoint. Host port is enabled by default and can be disabled. |
| features.otlp.receiver.protocols.grpc.endpoint | For OTLP/gRPC. gRPC supports several naming schemes: https://github.com/grpc/grpc/blob/master/doc/naming.md The Datadog Operator supports only 'host:port' (usually `0.0.0.0:port`). Default: `0.0.0.0:4317`. |
| features.otlp.receiver.protocols.grpc.hostPortConfig.enabled | Enables host port configuration |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const (
defaultOTLPHTTPHostPortEnabled bool = true
defaultOTLPHTTPEndpoint string = "0.0.0.0:4318"

defaultOTLPLogsEnabled bool = false

defaultRemoteConfigurationEnabled bool = true

defaultCollectKubernetesEvents bool = true
Expand Down Expand Up @@ -453,6 +455,8 @@ func defaultFeaturesConfig(ddaSpec *v2alpha1.DatadogAgentSpec) {

apiutils.DefaultStringIfUnset(&ddaSpec.Features.OTLP.Receiver.Protocols.HTTP.Endpoint, defaultOTLPHTTPEndpoint)

apiutils.DefaultBooleanIfUnset(&ddaSpec.Features.OTLP.Logs.Enabled, defaultOTLPLogsEnabled)

// RemoteConfiguration feature
if ddaSpec.Features.RemoteConfiguration == nil {
ddaSpec.Features.RemoteConfiguration = &v2alpha1.RemoteConfigurationFeatureConfig{}
Expand Down
Loading
Loading