Skip to content
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

Cannot open the synthetic detector UI when created from terraform #461

Open
knayakIDBS opened this issue Jan 10, 2024 · 0 comments
Open

Comments

@knayakIDBS
Copy link

knayakIDBS commented Jan 10, 2024

Hello,

I am creating a synthetic detector within a test. When navigating to the synthetic detector, getting an error which is described below

Here is my main.tf

  required_providers {
    synthetics = {
      version = "2.0.3"
      source  = "splunk/synthetics"
    }
	signalfx = {
	  version = "9.0.0"
	  source  = "splunk-terraform/signalfx"
	}
  }
}

provider "synthetics" {
  product = "observability"
  realm = "<REALM>"
  apikey = "<API-Key>"
}

provider "signalfx" {
  auth_token = "<API-Key>"
  api_url = "https://api.<REALM>.signalfx.com"
}

resource "synthetics_create_api_check_v2" "cluster_check" {
  count = var.signalfx_synthetic_monitor_enabled ? 1 : 0
  test {
    active = var.signalfx_synthetic_monitor_enabled
    device_id = 1  
    frequency = 1
    location_ids = <REGIONS>
    name = "Ping test"
    scheduling_strategy = "round_robin"
    requests {
      configuration {
        headers = {
          "Accept": "application/json"
          "x-foo": "bar-foo"
        }
        name = "Ping Cluster IP"
        request_method = "GET"
        url = "<URL>"
      }
      validations {
        actual = "{{response.code}}"
        comparator = "equals"
        expected = 200
        name = "Validate response code"
        type = "assert_numeric"
      }
    }
  }
}

resource "signalfx_detector" "synthetics_detector" {
  count = var.signalfx_synthetic_monitor_enabled ? 1 : 0
  name        = "Ping test"
  description = "Synthetics Detector for Ping test"
  program_text = <<-EOF
      from signalfx.detectors.synthetics import static
      static.detector(consecutive=3, filter_=(filter('test_type', 'api') and filter('test_id', '${synthetics_create_api_check_v2.cluster_check[0].id}')), fire_threshold=10, resource_type='synthetics.run.downtime.percent', use_location=False).publish('Ping test')
EOF

  rule {
    detect_label  = "Ping test"
    severity      = "Critical"
    description   = "Synthetics Detector for Ping test"
    disabled = false
  }
  
  disable_sampling = false
  show_data_markers = true
  show_event_lines = false
}
  1. terraform apply the above code. The test along with the synthetic detector gets created
  2. Login to the signalfx UI -> Synthetics(https://app..signalfx.com/#/synthetics)
  3. Naviagate to the test which you have created
  4. Edit Test -> Scroll down to the detectors
  5. Click on the detector which you have created

On clicking the detector, the following error is displayed : PFA
ErrorOccured

Here are some of the console logs which I found

Error: Unsupported detector object.
    at Bg (index.js:1:2997701)
    at index.js:1:2998886
    at tr (react-dom.js:2:57033)
    at Lr (react-dom.js:2:75307)
    at unstable_runWithPriority (react.js:2:8393)
    at xt (react-dom.js:2:23750)
    at Dr (react-dom.js:2:75059)
    at react-dom.js:2:74970
    at k (react.js:2:3903)
    at be.port1.onmessage (react.js:2:7725)
(anonymous) @ splunk.js:2
Gn @ react-dom.js:2
i.componentDidCatch.n.callback @ react-dom.js:2
Vt @ react-dom.js:2
nr @ react-dom.js:2
Rr @ react-dom.js:2
unstable_runWithPriority @ react.js:2
xt @ react-dom.js:2
Or @ react-dom.js:2
wr @ react-dom.js:2
(anonymous) @ react-dom.js:2
unstable_runWithPriority @ react.js:2
xt @ react-dom.js:2
Ct @ react-dom.js:2
St @ react-dom.js:2
Lr @ react-dom.js:2
unstable_runWithPriority @ react.js:2
xt @ react-dom.js:2
Dr @ react-dom.js:2
(anonymous) @ react-dom.js:2
k @ react.js:2
be.port1.onmessage @ react.js:2
15index.js:1 Uncaught TypeError: this.setState is not a function
    at readFromStorage (index.js:1:3620808)
readFromStorage @ index.js:1

This happens ONLY when I create test/detector through terraform. Please help me fix this issue. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants