Class: Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/monitoring/v3/alert.rb

Overview

A condition that allows alerting policies to be defined using GoogleSQL. SQL conditions examine a sliding window of logs using GoogleSQL. Alert policies with SQL conditions may incur additional billing.

Defined Under Namespace

Classes: BooleanTest, Daily, Hourly, Minutes, RowCountTest

Instance Attribute Summary collapse

Instance Attribute Details

#boolean_test::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::BooleanTest

Returns Test the boolean value in the indicated column.

Note: The following fields are mutually exclusive: boolean_test, row_count_test. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#daily::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Daily

Returns Schedule the query to execute every so many days.

Note: The following fields are mutually exclusive: daily, minutes, hourly. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#hourly::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Hourly

Returns Schedule the query to execute every so many hours.

Note: The following fields are mutually exclusive: hourly, minutes, daily. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#minutes::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::Minutes

Returns Schedule the query to execute every so many minutes.

Note: The following fields are mutually exclusive: minutes, hourly, daily. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#query::String

Returns Required. The Log Analytics SQL query to run, as a string. The query must conform to the required shape. Specifically, the query must not try to filter the input by time. A filter will automatically be applied to filter the input so that the query receives all rows received since the last time the query was run.

For example, the following query extracts all log entries containing an HTTP request:

SELECT
  timestamp, log_name, severity, http_request, resource, labels
FROM
  my-project.global._Default._AllLogs
WHERE
  http_request IS NOT NULL.

Returns:

  • (::String)

    Required. The Log Analytics SQL query to run, as a string. The query must conform to the required shape. Specifically, the query must not try to filter the input by time. A filter will automatically be applied to filter the input so that the query receives all rows received since the last time the query was run.

    For example, the following query extracts all log entries containing an HTTP request:

    SELECT
      timestamp, log_name, severity, http_request, resource, labels
    FROM
      my-project.global._Default._AllLogs
    WHERE
      http_request IS NOT NULL
    


677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#row_count_test::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::SqlCondition::RowCountTest

Returns Test the row count against a threshold.

Note: The following fields are mutually exclusive: row_count_test, boolean_test. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'proto_docs/google/monitoring/v3/alert.rb', line 677

class SqlCondition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Used to schedule the query to run every so many minutes.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. Number of minutes between runs. The interval must be
  #     greater than or equal to 5 minutes and less than or equal to 1440
  #     minutes.
  class Minutes
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many hours.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of hours between runs. Must be greater than or
  #     equal to 1 hour and less than or equal to 48 hours.
  # @!attribute [rw] minute_offset
  #   @return [::Integer]
  #     Optional. The number of minutes after the hour (in UTC) to run the
  #     query. Must be greater than or equal to 0 minutes and less than or
  #     equal to 59 minutes.  If left unspecified, then an arbitrary offset
  #     is used.
  class Hourly
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Used to schedule the query to run every so many days.
  # @!attribute [rw] periodicity
  #   @return [::Integer]
  #     Required. The number of days between runs. Must be greater than or
  #     equal to 1 day and less than or equal to 31 days.
  # @!attribute [rw] execution_time
  #   @return [::Google::Type::TimeOfDay]
  #     Optional. The time of day (in UTC) at which the query should run. If
  #     left unspecified, the server picks an arbitrary time of day and runs
  #     the query at the same time each day.
  class Daily
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that checks if the number of rows in the result set
  # violates some threshold.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     Required. The comparison to apply between the number of rows returned
  #     by the query and the threshold.
  # @!attribute [rw] threshold
  #   @return [::Integer]
  #     Required. The value against which to compare the row count.
  class RowCountTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A test that uses an alerting result in a boolean column produced by
  # the SQL query.
  # @!attribute [rw] column
  #   @return [::String]
  #     Required. The name of the column containing the boolean value. If the
  #     value in a row is NULL, that row is ignored.
  class BooleanTest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end