Skip to content

Commit

Permalink
fix: tests for logs2metric/spans2metric
Browse files Browse the repository at this point in the history
  • Loading branch information
celaus committed Nov 12, 2024
1 parent 57860a6 commit 13c8409
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@ Fix:

New Features

New Features:

* new endpoint: `[AP3, APAC3]`.

### resource/coralogix_dashboard

* Support for auto generated IDs added
Expand Down
14 changes: 7 additions & 7 deletions coralogix/resource_coralogix_events2metric_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2024 Coralogix Ltd.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// https://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestAccCoralogixResourceLogs2Metric(t *testing.T) {
resource.TestCheckResourceAttr(events2metricResourceName, "logs_query.lucene", "remote_addr_enriched:/.*/"),
resource.TestCheckResourceAttr(events2metricResourceName, "logs_query.applications.0", "nginx"),
resource.TestCheckResourceAttr(events2metricResourceName, "logs_query.severities.0", "Debug"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.source_field", "remote_addr_geoip.location_geopoint"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.source_field", "location_geopoint"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.avg.target_metric_name", "cx_avg"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.avg.enable", "true"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.count.target_metric_name", "cx_count"),
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestAccCoralogixResourceSpans2Metric(t *testing.T) {
resource.TestCheckResourceAttr(events2metricResourceName, "spans_query.applications.0", "nginx"),
resource.TestCheckResourceAttr(events2metricResourceName, "spans_query.actions.0", "action-name"),
resource.TestCheckResourceAttr(events2metricResourceName, "spans_query.services.0", "service-name"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.source_field", "remote_addr_geoip.location_geopoint"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.source_field", "location_geopoint"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.avg.target_metric_name", "cx_avg"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.avg.enable", "true"),
resource.TestCheckResourceAttr(events2metricResourceName, "metric_fields.geo_point.aggregations.count.target_metric_name", "cx_count"),
Expand Down Expand Up @@ -200,7 +200,7 @@ func testAccCoralogixResourceLogs2Metric(l *events2MetricTestFields) string {
source_field = "method"
},
geo_point = {
source_field = "remote_addr_geoip.location_geopoint"
source_field = "location_geopoint"
aggregations = {
max = {
enable = false
Expand Down Expand Up @@ -244,7 +244,7 @@ func testAccCoralogixResourceSpans2Metric(l *events2MetricTestFields) string {
source_field = "method"
},
geo_point = {
source_field = "remote_addr_geoip.location_geopoint"
source_field = "location_geopoint"
aggregations = {
max = {
enable = false
Expand Down
4 changes: 2 additions & 2 deletions examples/resources/coralogix_events2metric/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "coralogix_events2metric" "logs2metric" {
source_field = "method"
},
geo_point = {
source_field = "remote_addr_geoip.location_geopoint"
source_field = "location_geopoint"
aggregations = {
max = {
enable = false
Expand Down Expand Up @@ -53,7 +53,7 @@ resource "coralogix_events2metric" "spans2metric" {
source_field = "method"
},
geo_point = {
source_field = "remote_addr_geoip.location_geopoint"
source_field = "location_geopoint"
aggregations = {
max = {
enable = false
Expand Down

0 comments on commit 13c8409

Please sign in to comment.