Skip to content
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
25 changes: 22 additions & 3 deletions datadog/fwprovider/resource_datadog_observability_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ type observabilityPipelineModel struct {
}

type configModel struct {
Sources sourcesModel `tfsdk:"sources"`
Processors processorsModel `tfsdk:"processors"`
Destinations destinationsModel `tfsdk:"destinations"`
UseLegacySearchSyntax types.Bool `tfsdk:"use_legacy_search_syntax"`
Sources sourcesModel `tfsdk:"sources"`
Processors processorsModel `tfsdk:"processors"`
Destinations destinationsModel `tfsdk:"destinations"`
}
type sourcesModel struct {
DatadogAgentSource []*datadogAgentSourceModel `tfsdk:"datadog_agent"`
Expand Down Expand Up @@ -667,6 +668,12 @@ func (r *observabilityPipelineResource) Schema(_ context.Context, _ resource.Sch
Blocks: map[string]schema.Block{
"config": schema.SingleNestedBlock{
Description: "Configuration for the pipeline.",
Attributes: map[string]schema.Attribute{
"use_legacy_search_syntax": schema.BoolAttribute{
Optional: true,
Description: "Use this field to configure the pipeline's filter queries to use the deprecated search syntax.",
},
},
Blocks: map[string]schema.Block{
"sources": schema.SingleNestedBlock{
Description: "List of sources.",
Expand Down Expand Up @@ -2476,6 +2483,11 @@ func expandPipeline(ctx context.Context, state *observabilityPipelineModel) (*da

config := datadogV2.NewObservabilityPipelineConfigWithDefaults()

// Set use_legacy_search_syntax if provided
if !state.Config.UseLegacySearchSyntax.IsNull() {
config.SetUseLegacySearchSyntax(state.Config.UseLegacySearchSyntax.ValueBool())
}

// Sources
for _, s := range state.Config.Sources.DatadogAgentSource {
config.Sources = append(config.Sources, expandDatadogAgentSource(s))
Expand Down Expand Up @@ -2656,6 +2668,13 @@ func flattenPipeline(ctx context.Context, state *observabilityPipelineModel, res
cfg := attrs.GetConfig()
outCfg := configModel{}

// Handle use_legacy_search_syntax
if useLegacySearchSyntax, ok := cfg.GetUseLegacySearchSyntaxOk(); ok {
outCfg.UseLegacySearchSyntax = types.BoolValue(*useLegacySearchSyntax)
} else {
outCfg.UseLegacySearchSyntax = types.BoolNull()
}

for _, src := range cfg.GetSources() {

if a := flattenDatadogAgentSource(src.ObservabilityPipelineDatadogAgentSource); a != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-10-15T14:52:00.052773-04:00
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
---
version: 2
interactions:
- id: 0
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 364
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: |
{"data":{"attributes":{"config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":true},"name":"pipeline with legacy search"},"type":"pipelines"}}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines
method: POST
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 408
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":true}}}}
headers:
Content-Type:
- application/json
status: 201 Created
code: 201
duration: 914.891584ms
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 408
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":true}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 150.86525ms
- id: 2
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 408
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":true}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 204.988ms
- id: 3
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 373
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: |
{"data":{"attributes":{"config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":false},"name":"pipeline with legacy search"},"id":"","type":"pipelines"}}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: PUT
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 409
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":false}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 458.762541ms
- id: 4
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 409
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":false}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 177.643583ms
- id: 5
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 409
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}],"use_legacy_search_syntax":false}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 152.384541ms
- id: 6
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 340
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: |
{"data":{"attributes":{"config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}]},"name":"pipeline with legacy search"},"id":"","type":"pipelines"}}
form: {}
headers:
Accept:
- application/json
Content-Type:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: PUT
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 376
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}]}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 516.672041ms
- id: 7
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- application/json
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: GET
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 376
uncompressed: false
body: |
{"data":{"id":"08b64030-a9f8-11f0-9e79-da7ad0900002","type":"pipelines","attributes":{"name":"pipeline with legacy search","config":{"destinations":[{"id":"destination-1","inputs":["filter-1"],"type":"datadog_logs"}],"processors":[{"id":"filter-1","include":"service:my-service","inputs":["source-1"],"type":"filter"}],"sources":[{"id":"source-1","type":"datadog_agent"}]}}}}
headers:
Content-Type:
- application/json
status: 200 OK
code: 200
duration: 186.50725ms
- id: 8
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 0
transfer_encoding: []
trailer: {}
host: api.datadoghq.com
remote_addr: ""
request_uri: ""
body: ""
form: {}
headers:
Accept:
- '*/*'
url: https://api.datadoghq.com/api/v2/remote_config/products/obs_pipelines/pipelines/08b64030-a9f8-11f0-9e79-da7ad0900002
method: DELETE
response:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
transfer_encoding: []
trailer: {}
content_length: 0
uncompressed: false
body: ""
headers:
Content-Type:
- application/json
status: 204 No Content
code: 204
duration: 456.948292ms
Loading
Loading