From 6ee70c78c8a980cbb94162857bc3e0cf003b4acd Mon Sep 17 00:00:00 2001 From: Salah Eddine Bachir-Cherif Date: Wed, 10 Jul 2024 14:36:41 +0200 Subject: [PATCH 1/5] [apm_retention_filter] Fix inconsistent state problem --- .../fwprovider/resource_datadog_apm_retention_filter.go | 7 ++++--- .../tests/resource_datadog_apm_retention_filter_test.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/datadog/fwprovider/resource_datadog_apm_retention_filter.go b/datadog/fwprovider/resource_datadog_apm_retention_filter.go index 406814eb0..c6ceae243 100644 --- a/datadog/fwprovider/resource_datadog_apm_retention_filter.go +++ b/datadog/fwprovider/resource_datadog_apm_retention_filter.go @@ -127,7 +127,8 @@ func (r *ApmRetentionFilterResource) Read(ctx context.Context, request resource. } attributes := resp.Data.Attributes - r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), *attributes.Filter.Query, attributes.GetEnabled(), string(attributes.GetFilterType())) + fmt.Println("attributes", attributes.Filter.GetQuery()) + r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state response.Diagnostics.Append(response.State.Set(ctx, &state)...) @@ -160,7 +161,7 @@ func (r *ApmRetentionFilterResource) Create(ctx context.Context, request resourc } attributes := resp.Data.Attributes - r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), *attributes.Filter.Query, attributes.GetEnabled(), string(attributes.GetFilterType())) + r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state response.Diagnostics.Append(response.State.Set(ctx, &state)...) @@ -195,7 +196,7 @@ func (r *ApmRetentionFilterResource) Update(ctx context.Context, request resourc } attributes := resp.Data.Attributes - r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), *attributes.GetFilter().Query, attributes.GetEnabled(), string(attributes.GetFilterType())) + r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state response.Diagnostics.Append(response.State.Set(ctx, &state)...) diff --git a/datadog/tests/resource_datadog_apm_retention_filter_test.go b/datadog/tests/resource_datadog_apm_retention_filter_test.go index c0a436814..d3379359f 100644 --- a/datadog/tests/resource_datadog_apm_retention_filter_test.go +++ b/datadog/tests/resource_datadog_apm_retention_filter_test.go @@ -16,7 +16,7 @@ func TestAccApmRetentionFilter(t *testing.T) { t.Parallel() ctx, providers, accProviders := testAccFrameworkMuxProviders(context.Background(), t) uniq := uniqueEntityName(ctx, t) - query := "error_code:123 service:my-service" + query := "error_code:123 service:my-service @duration:>600ms" rate := "0.1" updatedQuery := "error_code:123" updatedRate := "1" From 40992f49551be6a7df24c557fb21a4e55c840dc0 Mon Sep 17 00:00:00 2001 From: Salah Eddine Bachir-Cherif Date: Wed, 10 Jul 2024 14:42:15 +0200 Subject: [PATCH 2/5] remove debug line --- datadog/fwprovider/resource_datadog_apm_retention_filter.go | 1 - 1 file changed, 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_apm_retention_filter.go b/datadog/fwprovider/resource_datadog_apm_retention_filter.go index c6ceae243..91c5e0845 100644 --- a/datadog/fwprovider/resource_datadog_apm_retention_filter.go +++ b/datadog/fwprovider/resource_datadog_apm_retention_filter.go @@ -127,7 +127,6 @@ func (r *ApmRetentionFilterResource) Read(ctx context.Context, request resource. } attributes := resp.Data.Attributes - fmt.Println("attributes", attributes.Filter.GetQuery()) r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state From a4936a4ca83c7dcceacf7afe3172ca56dda392a5 Mon Sep 17 00:00:00 2001 From: Salah Eddine Bachir-Cherif Date: Wed, 10 Jul 2024 14:42:23 +0200 Subject: [PATCH 3/5] update cassettes --- .../TestAccApmRetentionFilter.freeze | 2 +- .../cassettes/TestAccApmRetentionFilter.yaml | 312 +++++++++--------- 2 files changed, 149 insertions(+), 165 deletions(-) diff --git a/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze b/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze index 722152807..20207bf6c 100644 --- a/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze +++ b/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze @@ -1 +1 @@ -2024-01-16T15:28:02.191729-05:00 \ No newline at end of file +2024-07-10T14:41:40.719306+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml b/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml index a93b19912..b8a8cbcd0 100644 --- a/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml +++ b/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml @@ -6,77 +6,75 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 233 + content_length: 265 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123 service:my-service"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":0.1},"type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1},"type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters + url: https://api.datad0g.com/api/v2/apm/config/retention-filters method: POST response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":0.1,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 159.157458ms + duration: 251.095291ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 243 + content_length: 255 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123 service:my-service"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":0.1},"type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1},"type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters + url: https://api.datad0g.com/api/v2/apm/config/retention-filters method: POST response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":0.1,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 109.124458ms + duration: 227.2685ms - id: 2 request: proto: HTTP/1.1 @@ -85,7 +83,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -93,25 +91,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":0.1,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 84.076167ms + duration: 141.7685ms - id: 3 request: proto: HTTP/1.1 @@ -120,7 +117,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -128,25 +125,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":0.1,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 73.301958ms + duration: 1.023662s - id: 4 request: proto: HTTP/1.1 @@ -155,7 +151,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -163,25 +159,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":0.1,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 81.200125ms + duration: 126.99175ms - id: 5 request: proto: HTTP/1.1 @@ -190,7 +185,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -198,25 +193,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":0.1,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 119.213166ms + duration: 145.984583ms - id: 6 request: proto: HTTP/1.1 @@ -225,7 +219,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -233,25 +227,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":0.1,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 60.146792ms + duration: 126.756709ms - id: 7 request: proto: HTTP/1.1 @@ -260,7 +253,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -268,101 +261,98 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":0.1,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 service:my-service"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436883,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 74.34875ms + duration: 153.108417ms - id: 8 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 230 + content_length: 220 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":1},"id":"","type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1},"id":"","type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: PUT response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":1.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 104.256834ms + duration: 197.021375ms - id: 9 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 220 + content_length: 230 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":1},"id":"","type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1},"id":"","type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: PUT response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":1.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 143.066083ms + duration: 199.350208ms - id: 10 request: proto: HTTP/1.1 @@ -371,7 +361,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -379,25 +369,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":1.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 61.521792ms + duration: 129.626875ms - id: 11 request: proto: HTTP/1.1 @@ -406,7 +395,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -414,25 +403,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":1.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 68.295834ms + duration: 127.076625ms - id: 12 request: proto: HTTP/1.1 @@ -441,7 +429,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -449,25 +437,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"usD-JXgtR3KINhWUJUzbRw","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882 - second","rate":1.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 61.236083ms + duration: 127.296792ms - id: 13 request: proto: HTTP/1.1 @@ -476,7 +463,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -484,25 +471,24 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"0nzPg5AcRqO17TUnfAdI-g","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1705436882","rate":1.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1705436885,"created_by":"frog@datadoghq.com","created_at":1705436883},"type":"apm_retention_filter"}} + {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 70.568625ms + duration: 131.44925ms - id: 14 request: proto: HTTP/1.1 @@ -511,7 +497,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -519,12 +505,12 @@ interactions: headers: Accept: - '*/*' - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: DELETE response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 transfer_encoding: [] trailer: {} content_length: 3 @@ -536,7 +522,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 107.928083ms + duration: 246.304791ms - id: 15 request: proto: HTTP/1.1 @@ -545,7 +531,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -553,12 +539,12 @@ interactions: headers: Accept: - '*/*' - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: DELETE response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 transfer_encoding: [] trailer: {} content_length: 3 @@ -570,7 +556,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 106.647875ms + duration: 234.196167ms - id: 16 request: proto: HTTP/1.1 @@ -579,7 +565,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -587,24 +573,23 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/0nzPg5AcRqO17TUnfAdI-g + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true - body: '{"errors":["retention filter with id: ''0nzPg5AcRqO17TUnfAdI-g'' not found"]}' + body: '{"errors":["retention filter with id: ''5kzu8KWESL6hHy10Xli37w'' not found"]}' headers: Content-Type: - application/json status: 404 Not Found code: 404 - duration: 83.065083ms + duration: 138.437ms - id: 17 request: proto: HTTP/1.1 @@ -613,7 +598,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datadoghq.com + host: api.datad0g.com remote_addr: "" request_uri: "" body: "" @@ -621,21 +606,20 @@ interactions: headers: Accept: - application/json - url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/usD-JXgtR3KINhWUJUzbRw + url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A method: GET response: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - transfer_encoding: - - chunked + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] trailer: {} content_length: -1 uncompressed: true - body: '{"errors":["retention filter with id: ''usD-JXgtR3KINhWUJUzbRw'' not found"]}' + body: '{"errors":["retention filter with id: ''dlpGWducS8K0tlxplwoA9A'' not found"]}' headers: Content-Type: - application/json status: 404 Not Found code: 404 - duration: 68.9565ms + duration: 128.565625ms From 6a06b340f512273c89271432b0e7acf6e71a4df2 Mon Sep 17 00:00:00 2001 From: Salah Eddine Bachir-Cherif Date: Wed, 10 Jul 2024 14:58:34 +0200 Subject: [PATCH 4/5] update cassettes --- .../TestAccApmRetentionFilter.freeze | 2 +- .../cassettes/TestAccApmRetentionFilter.yaml | 304 +++++++++--------- 2 files changed, 161 insertions(+), 145 deletions(-) diff --git a/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze b/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze index 20207bf6c..bbabcd98e 100644 --- a/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze +++ b/datadog/tests/cassettes/TestAccApmRetentionFilter.freeze @@ -1 +1 @@ -2024-07-10T14:41:40.719306+02:00 \ No newline at end of file +2024-07-10T14:58:10.601784+02:00 \ No newline at end of file diff --git a/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml b/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml index b8a8cbcd0..86ac7582e 100644 --- a/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml +++ b/datadog/tests/cassettes/TestAccApmRetentionFilter.yaml @@ -9,35 +9,36 @@ interactions: content_length: 265 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1},"type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":0.1},"type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters method: POST response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 251.095291ms + duration: 503.03575ms - id: 1 request: proto: HTTP/1.1 @@ -46,35 +47,36 @@ interactions: content_length: 255 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1},"type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123 service:my-service @duration:\u003e600ms"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":0.1},"type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters method: POST response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 227.2685ms + duration: 189.032416ms - id: 2 request: proto: HTTP/1.1 @@ -83,7 +85,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -91,24 +93,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 141.7685ms + duration: 132.949083ms - id: 3 request: proto: HTTP/1.1 @@ -117,7 +120,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -125,24 +128,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 1.023662s + duration: 143.165667ms - id: 4 request: proto: HTTP/1.1 @@ -151,7 +155,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -159,24 +163,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 126.99175ms + duration: 142.340833ms - id: 5 request: proto: HTTP/1.1 @@ -185,7 +190,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -193,24 +198,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 145.984583ms + duration: 279.021584ms - id: 6 request: proto: HTTP/1.1 @@ -219,7 +225,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -227,24 +233,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615304,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":0.1,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 126.756709ms + duration: 135.344ms - id: 7 request: proto: HTTP/1.1 @@ -253,7 +260,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -261,24 +268,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615303,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":0.1,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123 AND service:my\\-service AND @duration:>600000000"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616292,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 153.108417ms + duration: 143.859709ms - id: 8 request: proto: HTTP/1.1 @@ -287,35 +295,36 @@ interactions: content_length: 220 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1},"id":"","type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":true,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":1},"id":"","type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: PUT response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616294,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 197.021375ms + duration: 191.222292ms - id: 9 request: proto: HTTP/1.1 @@ -324,35 +333,36 @@ interactions: content_length: 230 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: | - {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1},"id":"","type":"apm_retention_filter"}} + {"data":{"attributes":{"enabled":false,"filter":{"query":"error_code:123"},"filter_type":"spans-sampling-processor","name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":1},"id":"","type":"apm_retention_filter"}} form: {} headers: Accept: - application/json Content-Type: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: PUT response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616295,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 199.350208ms + duration: 196.347708ms - id: 10 request: proto: HTTP/1.1 @@ -361,7 +371,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -369,24 +379,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616294,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 129.626875ms + duration: 137.876083ms - id: 11 request: proto: HTTP/1.1 @@ -395,7 +406,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -403,24 +414,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616295,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 127.076625ms + duration: 127.623209ms - id: 12 request: proto: HTTP/1.1 @@ -429,7 +441,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -437,24 +449,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"5kzu8KWESL6hHy10Xli37w","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615304},"type":"apm_retention_filter"}} + {"data":{"id":"rIbF0jxFSMeXs75nduLCkA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290","rate":1.0,"trace_rate":0.0,"enabled":true,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616294,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 127.296792ms + duration: 139.477792ms - id: 13 request: proto: HTTP/1.1 @@ -463,7 +476,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -471,24 +484,25 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true body: | - {"data":{"id":"dlpGWducS8K0tlxplwoA9A","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720615300 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"salah.bachircherif@datadoghq.com","modified_at":1720615307,"created_by":"salah.bachircherif@datadoghq.com","created_at":1720615303},"type":"apm_retention_filter"}} + {"data":{"id":"qu0N5MSuSYao_C6cNMKOFA","attributes":{"name":"tf-TestAccApmRetentionFilter-local-1720616290 - second","rate":1.0,"trace_rate":0.0,"enabled":false,"filter_type":"spans-sampling-processor","filter":{"query":"error_code:123"},"editable":true,"modified_by":"frog@datadoghq.com","modified_at":1720616295,"created_by":"frog@datadoghq.com","created_at":1720616292},"type":"apm_retention_filter"}} headers: Content-Type: - application/json status: 200 OK code: 200 - duration: 131.44925ms + duration: 151.643417ms - id: 14 request: proto: HTTP/1.1 @@ -497,7 +511,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -505,12 +519,12 @@ interactions: headers: Accept: - '*/*' - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: DELETE response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 transfer_encoding: [] trailer: {} content_length: 3 @@ -522,7 +536,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 246.304791ms + duration: 192.615167ms - id: 15 request: proto: HTTP/1.1 @@ -531,7 +545,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -539,12 +553,12 @@ interactions: headers: Accept: - '*/*' - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: DELETE response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 transfer_encoding: [] trailer: {} content_length: 3 @@ -556,7 +570,7 @@ interactions: - application/json status: 200 OK code: 200 - duration: 234.196167ms + duration: 179.549375ms - id: 16 request: proto: HTTP/1.1 @@ -565,7 +579,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -573,23 +587,24 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/5kzu8KWESL6hHy10Xli37w + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/rIbF0jxFSMeXs75nduLCkA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true - body: '{"errors":["retention filter with id: ''5kzu8KWESL6hHy10Xli37w'' not found"]}' + body: '{"errors":["retention filter with id: ''rIbF0jxFSMeXs75nduLCkA'' not found"]}' headers: Content-Type: - application/json status: 404 Not Found code: 404 - duration: 138.437ms + duration: 142.091667ms - id: 17 request: proto: HTTP/1.1 @@ -598,7 +613,7 @@ interactions: content_length: 0 transfer_encoding: [] trailer: {} - host: api.datad0g.com + host: api.datadoghq.com remote_addr: "" request_uri: "" body: "" @@ -606,20 +621,21 @@ interactions: headers: Accept: - application/json - url: https://api.datad0g.com/api/v2/apm/config/retention-filters/dlpGWducS8K0tlxplwoA9A + url: https://api.datadoghq.com/api/v2/apm/config/retention-filters/qu0N5MSuSYao_C6cNMKOFA method: GET response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + transfer_encoding: + - chunked trailer: {} content_length: -1 uncompressed: true - body: '{"errors":["retention filter with id: ''dlpGWducS8K0tlxplwoA9A'' not found"]}' + body: '{"errors":["retention filter with id: ''qu0N5MSuSYao_C6cNMKOFA'' not found"]}' headers: Content-Type: - application/json status: 404 Not Found code: 404 - duration: 128.565625ms + duration: 138.314333ms From 04380376c338a2284048c4bdb1227b8fc39e36d7 Mon Sep 17 00:00:00 2001 From: Salah Eddine Bachir-Cherif Date: Wed, 10 Jul 2024 15:13:44 +0200 Subject: [PATCH 5/5] add comment --- .../fwprovider/resource_datadog_apm_retention_filter.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/datadog/fwprovider/resource_datadog_apm_retention_filter.go b/datadog/fwprovider/resource_datadog_apm_retention_filter.go index 91c5e0845..1deadba65 100644 --- a/datadog/fwprovider/resource_datadog_apm_retention_filter.go +++ b/datadog/fwprovider/resource_datadog_apm_retention_filter.go @@ -127,6 +127,9 @@ func (r *ApmRetentionFilterResource) Read(ctx context.Context, request resource. } attributes := resp.Data.Attributes + + // state.Filter.Query.ValueString() is used instead of attributes.Filter.Query.ValueString() because + // the API might re-write the query (i.e. to convert units), but it stays symantically the same r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state @@ -160,6 +163,8 @@ func (r *ApmRetentionFilterResource) Create(ctx context.Context, request resourc } attributes := resp.Data.Attributes + // state.Filter.Query.ValueString() is used instead of attributes.Filter.Query.ValueString() because + // the API might re-write the query (i.e. to convert units), but it stays symantically the same r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state @@ -195,6 +200,8 @@ func (r *ApmRetentionFilterResource) Update(ctx context.Context, request resourc } attributes := resp.Data.Attributes + // state.Filter.Query.ValueString() is used instead of attributes.Filter.Query.ValueString() because + // the API might re-write the query (i.e. to convert units), but it stays symantically the same r.updateState(ctx, &state, resp.Data.Id, attributes.GetName(), attributes.GetRate(), state.Filter.Query.ValueString(), attributes.GetEnabled(), string(attributes.GetFilterType())) // Save data into Terraform state @@ -223,7 +230,7 @@ func (r *ApmRetentionFilterResource) Delete(ctx context.Context, request resourc } } -func (r *ApmRetentionFilterResource) updateState(ctx context.Context, state *ApmRetentionFilterModel, dataId string, name string, rate float64, query string, enabled bool, filterType string) { +func (r *ApmRetentionFilterResource) updateState(_ context.Context, state *ApmRetentionFilterModel, dataId string, name string, rate float64, query string, enabled bool, filterType string) { state.ID = types.StringValue(dataId) state.Name = types.StringValue(name)