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.

Returns:



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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.

Returns:



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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.

Returns:



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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.

Returns:



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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
    


651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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.

Returns:



651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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
# File 'proto_docs/google/monitoring/v3/alert.rb', line 651

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