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

Monitored Service Prometheus Metric definition got 500 error #974

Open
gilankpam opened this issue May 2, 2024 · 0 comments
Open

Monitored Service Prometheus Metric definition got 500 error #974

gilankpam opened this issue May 2, 2024 · 0 comments

Comments

@gilankpam
Copy link

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v1.8.2
on linux_amd64

Affected Resource(s)

Please list the resources as a list, for example:

  • harness_platform_monitored_service

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "harness_platform_monitored_service" "test" {
  org_id     = "myOrg"
  project_id = "test"
  identifier = "test_account.prod"
  request {
    name            = "test_account.prod"
    type            = "Application"
    description     = "description"
    service_ref     = "test"
    environment_ref = "account.prod"
    tags            = ["foo:bar", "bar:foo"]
    health_sources {
      name       = "prometheus metrics verify step"
      identifier = "prometheus_metrics"
      type       = "Prometheus"
      spec = jsonencode({
        connectorRef = "account.prometheus_prod"
        metricDefinitions = [
          {
            identifier = "Prometheus_Metric",
            metricName = "Prometheus Metric",
            riskProfile = {
              riskCategory = "Performance_Other"
              thresholdTypes = [
                "ACT_WHEN_HIGHER"
              ]
            }
            analysis = {
              liveMonitoring = {
                enabled = false
              }
              deploymentVerification = {
                enabled                  = true
                serviceInstanceFieldName = "pod"
              }
            }
            sli = {
                enabled = true
            }
            query         = "count(up{group=\"cv\",group=\"cv\"})"
            groupName     = "availability"
            isManualQuery = true
          }
        ]
      })
    }
  }
}

Debug Output

2024-05-02T16:15:45.771+0700 [DEBUG] provider.terraform-provider-harness_v0.30.8: 2024/05/02 16:15:45 [DEBUG] POST https://app.harness.io/gateway/cv/api/monitored-service?accountId=xxxxxxxxxxxxxxxxxxxx (status: 500): retrying in 2s (9 left)
2024-05-02T16:15:45.771+0700 [WARN]  unexpected data:
  registry.terraform.io/harness/harness:stderr=
  | 2024-05-02 16:15:45 [DEBUG] harness-go-sdk harness-go-sdk API Response Details:
  | ---[ RESPONSE ]--------------------------------------
  | HTTP/2.0 500 Internal Server Error\r
  | Content-Length: 51\r
  | Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000\r
  | Content-Type: application/json\r
  | Date: Thu, 02 May 2024 09:15:45 GMT\r
  | Strict-Transport-Security: max-age=15724800; includeSubDomains\r
  | Via: 1.1 google\r
  | X-Harness-Trace-Id: 77355fc34a2c2d8afbadb042f0b501e0\r
  | \r
  | HV000028: Unexpected exception during isValid call.
  | -----------------------------------------------------

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

Should create the monitored service

Actual Behavior

API server returned 500. If I set sli.enabled, liveMonitoring.enabled and deploymentVerification.enabled to true. I got no problem. Same thing happen for PUT also. But with different error message like

Cannot invoke \"java.lang.Boolean.booleanValue()\" because the return value of \"io.harness.cvng.core.beans.HealthSourceMetricDefinition$SLIDTO.getEnabled()\" is null

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

References

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

No branches or pull requests

1 participant