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

Terraform config does not include check frequency or timeout #1028

Open
peterschretlen opened this issue Dec 19, 2024 · 1 comment
Open

Terraform config does not include check frequency or timeout #1028

peterschretlen opened this issue Dec 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@peterschretlen
Copy link
Contributor

What happened:

Under Testing & synthetics > Synthetics > Config > Terraform
The JSON config that is generated is missing the frequency of the check.

Example of a scripted check with a 300s interval and a 30s timeout:
Image

Note the script doesn't show up either, which is a known issue #853

What you expected to happen:

There should be a frequency value of 300,000 and a timeout of 30,000. Here is the terraform version of this check in HCL format:

resource "grafana_synthetic_monitoring_check" "scripted" {
  provider  = grafana.sm
  job       = "Scripted check 1"
  target    = "https://grafana.com/"
  enabled   = true
  frequency = 300000
  timeout   = 30000
  probes = [
    data.grafana_synthetic_monitoring_probes.main.probes.Paris,
  ]
  labels = {
    environment = "production"
  }
  settings {
    scripted {
      // `script.js` is a file in the same directory as this file and contains the
      // script to be executed.
      script = file("${path.module}/sm-scripts/scripted-check1.js")
    }
  }
}

Environment:
plugin v1.16.10

@peterschretlen peterschretlen added the bug Something isn't working label Dec 19, 2024
@peterschretlen
Copy link
Contributor Author

Probably an oversight here, timeout and frequency are not part of the TFCheck interface:

export interface TFCheck {
job: string;
target: string;
enabled: boolean;
probes: number[];
labels: TFLabels;
settings: TFCheckSettings;
}

And then they would need to be set here:

export const checkToTF = (check: Check): TFCheck => {
const tfCheck = {
job: check.job,
target: check.target,
enabled: check.enabled,
probes: check.probes,
labels: labelsToTFLabels(check.labels),
settings: settingsToTF(check),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant