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

[Bug] Inconsistency between Kibana SLO API and GO schema #867

Open
ntls31 opened this issue Oct 23, 2024 · 2 comments
Open

[Bug] Inconsistency between Kibana SLO API and GO schema #867

ntls31 opened this issue Oct 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ntls31
Copy link

ntls31 commented Oct 23, 2024

Describe the bug
There is some inconsistencies between the GO variable schema and the Kibana API to create a SLO, in the "params" settings :

This inconsistency between the API and Go code leads to an issue when creating a filter which includes a bool query and a KQL query.

Versions:

  • Terraform Version : 1.9.7
  • Provider version 0.11.9
  • Elasticsearch Version : 8.15.2
@ntls31 ntls31 added the bug Something isn't working label Oct 23, 2024
@tobio
Copy link
Member

tobio commented Nov 5, 2024

This inconsistency between the API and Go code leads to an issue when creating a filter which includes a bool query and a KQL query.

@ntls31 do you have an example config reproducing this issue?

@ntls31
Copy link
Author

ntls31 commented Nov 5, 2024

@tobio, here an example of a SLO configuration deployed by the customer working through the kibana API (but not with terraform):

POST kbn:/api/observability/slos
{
  "name": "slo",
  "description": "",
  "indicator": {
    "type": "sli.kql.custom",
    "params": {
      "index": "metrics-*",
      "filter": {
        "filters": [
          {
            "query": {
              "bool": {
                "filter": [
                  {
                    "script": {
                      "script": {
                        "source": "doc['@timestamp'].value.getHour() >= params.startHour && doc['@timestamp'].value.getHour() <= params.endHour",
                        "params": {
                          "startHour": 7,
                          "endHour": 14
                        }
                      }
                    }
                  }
                ]
              }
            },
            "meta": {
              "index": "metrics-*",
              "type": "custom",
              "disabled": false,
              "negate": false,
              "alias": "test"
            }
          }
        ],
        "kqlQuery": "metricset.name : \"state_deployment\""
      },
      "good": """metricset.name : "state_deployment" and kubernetes.deployment.status.available : "true" """,
      "total": """metricset.name : "state_deployment" and kubernetes.deployment.status.available : * """,
      "timestampField": "@timestamp",
      "dataViewId": "xxx"
    }
  },
  "budgetingMethod": "occurrences",
  "timeWindow": {
    "duration": "7d",
    "type": "rolling"
  },
  "objective": {
    "target": 0.99
  },
  "tags": [],
  "groupBy": [
    "*"
  ],
  "settings": {
    "preventInitialBackfill": false
  }
}

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

2 participants