<commit_before>- name: mysql.alerts
  rules:
  - alert: {{ include "alerts.service" . | title }}MariaDBTooManyConnections
    expr: (mysql_global_variables_max_connections{app=~"{{ include "fullName" . }}"} - mysql_global_status_threads_connected{app=~"{{ include "fullName" . }}"} < 200)
    for: 30m
    labels:
      context: datbase
      service: {{ include "alerts.service" . }}
      severity: warning
      tier: {{ required ".Values.alerts.tier missing" .Values.alerts.tier }}
    annotations:
      description: {{ include "fullName" . }} has too many connections open. Please check the service containers.
      summary: {{ include "fullName" . }} has too many connections open.

  - alert: {{ include "alerts.service" . | title }}MariaDBSlowQueries
    expr: (rate(mysql_global_status_slow_queries{app=~"{{ include "fullName" . }}"}[5m]) > 0)
    for: 10m
    labels:
      context: database
      service: {{ include "alerts.service" . }}
      severity: warning
      tier: {{ required ".Values.alerts.tier missing" .Values.alerts.tier }}
    annotations:
      description: {{ include "fullName" . }} has reported slow queries. Please check the DB.
      summary: {{ include "fullName" . }} reports slow queries.

  - alert: {{ include "alerts.service" . | title }}MariaDBWaitingForLock
    expr: (mysql_info_schema_threads_seconds{app=~"{{ include "fullName" . }}", state=~"waiting for lock"} / 1000  > 15)
    for: 10m<commit_msg>mariadb: add playbook for ManilaMariaDBSlowQueries<commit_after>- name: mysql.alerts
  rules:
  - alert: {{ include "alerts.service" . | title }}MariaDBTooManyConnections
    expr: (mysql_global_variables_max_connections{app=~"{{ include "fullName" . }}"} - mysql_global_status_threads_connected{app=~"{{ include "fullName" . }}"} < 200)
    for: 30m
    labels:
      context: datbase
      service: {{ include "alerts.service" . }}
      severity: warning
      tier: {{ required ".Values.alerts.tier missing" .Values.alerts.tier }}
    annotations:
      description: {{ include "fullName" . }} has too many connections open. Please check the service containers.
      summary: {{ include "fullName" . }} has too many connections open.

  - alert: {{ include "alerts.service" . | title }}MariaDBSlowQueries
    expr: (rate(mysql_global_status_slow_queries{app=~"{{ include "fullName" . }}"}[5m]) > 0)
    for: 10m
    labels:
      context: database
      service: {{ include "alerts.service" . }}
      severity: warning
      tier: {{ required ".Values.alerts.tier missing" .Values.alerts.tier }}
      playbook: 'docs/support/playbook/manila/ManilaMariaDBSlowQueries.html'
    annotations:
      description: {{ include "fullName" . }} has reported slow queries. Please check the DB.
      summary: {{ include "fullName" . }} reports slow queries.

  - alert: {{ include "alerts.service" . | title }}MariaDBWaitingForLock
    expr: (mysql_info_schema_threads_seconds{app=~"{{ include "fullName" . }}", state=~"waiting for lock"} / 1000  > 15)
    for: 10m
{'fraction_non_alphanumeric': 0.14128989361702127, 'fraction_numerical': 0.011303191489361703, 'mean_word_length': 3.504491017964072, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '819276', 'n_tokens_mistral': 978, 'n_tokens_neox': 910, 'n_words': 233}