Sha256: 3e5f2fbec0918362c07a9df1f46cc54e7d3c92123c310ca79a8be988182b9151

Contents?: true

Size: 764 Bytes

Versions: 16

Compression:

Stored size: 764 Bytes

Contents

# Create an Error Tracking monitor returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::MonitorsAPI.new

body = DatadogAPIClient::V1::Monitor.new({
  name: "Example-Create_an_Error_Tracking_monitor_returns_OK_response",
  type: DatadogAPIClient::V1::MonitorType::ERROR_TRACKING_ALERT,
  query: 'error-tracking-rum("service:foo AND @error.source:source").rollup("count").by("@issue.id").last("1h") >= 1',
  message: "some message",
  tags: [
    "test:examplecreateanerrortrackingmonitorreturnsokresponse",
    "env:ci",
  ],
  priority: 3,
  options: DatadogAPIClient::V1::MonitorOptions.new({
    thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
      critical: 1,
    }),
  }),
})
p api_instance.create_monitor(body)

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
datadog_api_client-2.9.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.8.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.7.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.6.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.5.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.4.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.3.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.2.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.1.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.0.2 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.0.1 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-2.0.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-1.11.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-1.10.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-1.9.0 examples/v1/monitors/CreateMonitor_440013737.rb
datadog_api_client-1.8.0 examples/v1/monitors/CreateMonitor_440013737.rb