elastic / uptime

This project includes resources and general issue tracking for the Elastic Uptime solution
12 stars 3 forks source link

[Uptime] `enabled` key is not pushed to synthetics service when it is `false` #424

Closed awahab07 closed 2 years ago

awahab07 commented 2 years ago

When monitor configurations are pushed to Synthetics Service, enabled key is dropped from payload for disabled monitors (enabled: false).

For example the following payload is pushed for an example enabled monitor:

{
  monitors: [
    {
      type: 'http',
      locations: [Array],
      enabled: true,
      schedule: '@every 3m',
      timeout: '16s',
      name: 'Disabled LATAM Monitor',
      urls: 'https://disabled-example.com',
      max_redirects: '0',
      'response.include_body': 'on_error',
      'response.include_headers': true,
      'check.request.method': 'GET',
      id: 'ab45ccc0-5e6c-11ec-b6b6-19f2ac56f0b7'
    }
  ],
  output: {
    hosts: [ 'https://localhost:9200' ],
    api_key: 'bvKDuH0BXEsoI3O2v6zx:RZHMhLChSNaXruM5HDaTaQ'
  }
}

When the same monitor is edited with it's Enabled field toggled off, the following payload is sent:

{
  monitors: [
    {
      type: 'http',
      locations: [Array],
      schedule: '@every 3m',
      timeout: '16s',
      name: 'Disabled LATAM Monitor',
      urls: 'https://disabled-example.com',
      max_redirects: '0',
      'response.include_body': 'on_error',
      'response.include_headers': true,
      'check.request.method': 'GET',
      id: 'ab45ccc0-5e6c-11ec-b6b6-19f2ac56f0b7'
    }
  ],
  output: {
    hosts: [ 'https://localhost:9200' ],
    api_key: 'bvKDuH0BXEsoI3O2v6zx:RZHMhLChSNaXruM5HDaTaQ'
  }
}

Notice that enabled key is dropped from the payload. And the monitor will not be disabled by the Synthetics Service.

Expected: When a monitor is disabled, payload should contain enabled: false for that monitor.