Skip to content

Commit

Permalink
[GCP][CloudSQL] Set metric type (#7556)
Browse files Browse the repository at this point in the history
* Set metric type.

Signed-off-by: constanca-m <constanca.manteigas@elastic.co>

* Update changelog.

Signed-off-by: constanca-m <constanca.manteigas@elastic.co>

---------

Signed-off-by: constanca-m <constanca.manteigas@elastic.co>
  • Loading branch information
constanca-m committed Aug 29, 2023
1 parent 769b005 commit 69bfb75
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 104 deletions.
5 changes: 5 additions & 0 deletions packages/gcp/changelog.yml
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "2.28.1"
changes:
- description: Set metric type for CloudSQL data streams.
type: enhancement
link: https://github.com/elastic/integrations/pull/7556
- version: "2.28.0"
changes:
- description: Migrate GCP Load Balancing L3 Overview dashboard to lens.
Expand Down
40 changes: 22 additions & 18 deletions packages/gcp/data_stream/cloudsql_mysql/fields/fields.yml
Expand Up @@ -12,7 +12,7 @@
description: Indicates whether the instance is currently available using Windows Authentication.
- name: database.auto_failover_request.count
type: long
metric_type: counter
metric_type: gauge
description: Delta of number of instance auto-failover requests.
- name: database.available_for_failover
type: long
Expand All @@ -25,9 +25,11 @@
- name: database.cpu.usage_time.sec
type: double
unit: s
description: Cumulative CPU usage time in seconds.
metric_type: gauge
description: Delta CPU usage time in seconds.
- name: database.cpu.utilization.pct
type: double
unit: percent
metric_type: gauge
description: Current CPU utilization represented as a percentage of the reserved CPU that is currently in use.
- name: database.disk.bytes_used.bytes
Expand All @@ -47,15 +49,16 @@
description: Maximum data disk size in bytes.
- name: database.disk.read_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk read IO operations.
- name: database.disk.utilization.pct
type: double
unit: percent
metric_type: gauge
description: The fraction of the disk quota that is currently in use.
- name: database.disk.write_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk write IO operations.
- name: database.instance_state
type: long
Expand Down Expand Up @@ -95,31 +98,31 @@
description: Total number of pages in the InnoDB buffer pool.
- name: database.innodb_data_fsyncs.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of InnoDB fsync() calls.
- name: database.innodb_os_log_fsyncs.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of InnoDB fsync() calls to the log file.
- name: database.innodb_pages_read.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of InnoDB pages read.
- name: database.innodb_pages_written.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of InnoDB pages written.
- name: database.queries.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of statements executed by the server.
- name: database.questions.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of statements executed by the server sent by the client.
- name: database.received_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes received by MySQL process.
- name: database.replication.last_io_errno
type: long
Expand Down Expand Up @@ -150,28 +153,28 @@
description: Indicates whether the SQL thread for executing events in the relay log is running. Possible values are Yes / No, and the values are exposed through the 'state' field.
- name: database.sent_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes sent by MySQL process.
- name: database.network.connections.count
type: long
metric_type: gauge
description: Number of connections to databases on the Cloud SQL instance. Only applicable to MySQL and SQL Server.
- name: database.network.received_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes received through the network.
- name: database.network.sent_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes sent through the network.
- name: database.replication.log_archive_failure.count
type: long
metric_type: counter
description: Number of failed attempts for archiving replication log files.
metric_type: gauge
description: Delta number of failed attempts for archiving replication log files.
- name: database.replication.log_archive_success.count
type: long
metric_type: counter
description: Number of successful attempts for archiving replication log files.
metric_type: gauge
description: Delta number of successful attempts for archiving replication log files.
- name: database.replication.network_lag.sec
type: long
unit: s
Expand All @@ -196,4 +199,5 @@
- name: database.uptime.sec
type: long
unit: s
metric_type: gauge
description: Delta count of the time in seconds the instance has been running.
48 changes: 30 additions & 18 deletions packages/gcp/data_stream/cloudsql_postgresql/fields/fields.yml
Expand Up @@ -12,7 +12,7 @@
description: Indicates whether the instance is currently available using Windows Authentication.
- name: database.auto_failover_request.count
type: long
metric_type: counter
metric_type: gauge
description: Delta of number of instance auto-failover requests.
- name: database.available_for_failover
type: long
Expand All @@ -25,7 +25,8 @@
- name: database.cpu.usage_time.sec
type: double
unit: s
description: Cumulative CPU usage time in seconds.
metric_type: gauge
description: Delta CPU usage time in seconds.
- name: database.cpu.utilization.pct
type: double
unit: percent
Expand All @@ -48,7 +49,7 @@
description: Maximum data disk size in bytes.
- name: database.disk.read_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk read IO operations.
- name: database.disk.utilization.pct
type: double
Expand All @@ -57,7 +58,7 @@
description: The fraction of the disk quota that is currently in use.
- name: database.disk.write_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk write IO operations.
- name: database.instance_state
type: long
Expand Down Expand Up @@ -89,20 +90,20 @@
description: Number of connections to databases on the Cloud SQL instance. Only applicable to MySQL and SQL Server.
- name: database.network.received_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes received through the network.
- name: database.network.sent_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes sent through the network.
- name: database.blocks_read.count
type: long
metric_type: counter
description: Number of disk blocks read by this database. The source field distingushes actual reads from disk versus reads from buffer cache.
metric_type: gauge
description: Delta count of disk blocks read by this database. The source field distingushes actual reads from disk versus reads from buffer cache.
- name: database.deadlock.count
type: long
metric_type: counter
description: Number of deadlocks detected for this database.
metric_type: gauge
description: Delta count of deadlocks detected for this database.
- name: database.external_sync.initial_sync_complete
type: long
metric_type: gauge
Expand All @@ -114,15 +115,19 @@
description: Replication lag in bytes for Postgres External Server (ES) replicas. Aggregated across all DBs on the replica.
- name: database.insights.aggregate.execution_time
type: long
metric_type: counter
description: Accumulated query execution time per user per database. This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.
- name: database.insights.aggregate.io_time
type: long
metric_type: counter
description: Accumulated IO time per user per database.
- name: database.insights.aggregate.latencies
type: long
metric_type: counter
description: Query latency distribution per user per database.
- name: database.insights.aggregate.lock_time
type: long
metric_type: counter
description: Accumulated lock wait time per user per database.
- name: database.insights.aggregate.row.count
type: long
Expand All @@ -134,15 +139,18 @@
description: Shared blocks (regular tables & indexed) accessed by statement execution.
- name: database.insights.perquery.execution_time
type: long
metric_type: counter
description: Accumulated execution times per user per database per query.This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.
- name: database.insights.perquery.io_time
type: long
metric_type: counter
description: Accumulated IO time per user per database per query.
- name: database.insights.perquery.latencies
type: histogram
description: Query latency distribution per user per database per query.
- name: database.insights.perquery.lock_time
type: long
metric_type: counter
description: Accumulated lock wait time per user per database per query.
- name: database.insights.perquery.row.count
type: long
Expand All @@ -154,15 +162,18 @@
description: Shared blocks (regular tables & indexed) accesssed by statement execution.
- name: database.insights.pertag.execution_time
type: long
metric_type: counter
description: Accumulated execution times per user per database per tag.This is the sum of cpu time, io wait time, lock wait time, process context switch, and scheduling for all the processes involved in the query execution.
- name: database.insights.pertag.io_time
type: long
metric_type: counter
description: Accumulated IO write time per user per database per tag.
- name: database.insights.pertag.latencies
type: histogram
description: Query latency distribution per user per database per tag.
- name: database.insights.pertag.lock_time
type: long
metric_type: counter
description: Accumulated lock wait time per user per database per tag.
- name: database.insights.pertag.row.count
type: long
Expand All @@ -187,11 +198,11 @@
description: Replication lag in bytes. Reported from the master per replica.
- name: database.transaction.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of number of transactions.
- name: database.transaction_id.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of transaction ID.
- name: database.transaction_id_utilization.pct
type: double
Expand All @@ -204,20 +215,20 @@
description: Number of tuples (rows) in the database.
- name: database.tuples_processed.count
type: long
metric_type: counter
description: Number of tuples(rows) processed for a given database for operations like insert, update or delete.
metric_type: gauge
description: Delta count of tuples(rows) processed for a given database for operations like insert, update or delete.
- name: database.vacuum.oldest_transaction_age
type: long
metric_type: gauge
description: Age of the oldest transaction yet to be vacuumed in the Cloud SQL PostgreSQL instance, measured in number of transactions that have happened since the oldest transaction.
- name: database.replication.log_archive_failure.count
type: long
metric_type: counter
description: Number of failed attempts for archiving replication log files.
metric_type: gauge
description: Delta count of failed attempts for archiving replication log files.
- name: database.replication.log_archive_success.count
type: long
metric_type: counter
description: Number of successful attempts for archiving replication log files.
metric_type: gauge
description: Delta count of successful attempts for archiving replication log files.
- name: database.replication.network_lag.sec
type: long
unit: s
Expand All @@ -242,4 +253,5 @@
- name: database.uptime.sec
type: long
unit: s
metric_type: gauge
description: Delta count of the time in seconds the instance has been running.
28 changes: 15 additions & 13 deletions packages/gcp/data_stream/cloudsql_sqlserver/fields/fields.yml
Expand Up @@ -12,7 +12,7 @@
description: Indicates whether the instance is currently available using Windows Authentication.
- name: database.auto_failover_request.count
type: long
metric_type: counter
metric_type: gauge
description: Delta of number of instance auto-failover requests.
- name: database.available_for_failover
type: long
Expand All @@ -25,7 +25,8 @@
- name: database.cpu.usage_time.sec
type: double
unit: s
description: Cumulative CPU usage time in seconds.
metric_type: gauge
description: Delta CPU usage time in seconds.
- name: database.cpu.utilization.pct
type: double
unit: percent
Expand All @@ -48,7 +49,7 @@
description: Maximum data disk size in bytes.
- name: database.disk.read_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk read IO operations.
- name: database.disk.utilization.pct
type: double
Expand All @@ -57,7 +58,7 @@
description: The fraction of the disk quota that is currently in use.
- name: database.disk.write_ops.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of data disk write IO operations.
- name: database.instance_state
type: long
Expand Down Expand Up @@ -89,20 +90,20 @@
description: Number of connections to databases on the Cloud SQL instance. Only applicable to MySQL and SQL Server.
- name: database.network.received_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes received through the network.
- name: database.network.sent_bytes.count
type: long
metric_type: counter
metric_type: gauge
description: Delta count of bytes sent through the network.
- name: database.replication.log_archive_failure.count
type: long
metric_type: counter
description: Number of failed attempts for archiving replication log files.
metric_type: gauge
description: Delta count of failed attempts for archiving replication log files.
- name: database.replication.log_archive_success.count
type: long
metric_type: counter
description: Number of successful attempts for archiving replication log files.
metric_type: gauge
description: Delta count of successful attempts for archiving replication log files.
- name: database.replication.network_lag.sec
type: long
unit: s
Expand All @@ -120,12 +121,12 @@
- name: database.audits_size.bytes
type: long
unit: byte
metric_type: counter
metric_type: gauge
description: Tracks the size in bytes of stored SQLServer audit files on an instance.
- name: database.audits_upload.count
type: long
metric_type: counter
description: Counts total number of SQLServer audit file uploads to a GCS bucket and whether or not an upload was successful.
metric_type: gauge
description: Delta count of total number of SQLServer audit file uploads to a GCS bucket and whether or not an upload was successful.
- name: database.external_sync.primary_to_replica_connection_health
type: long
metric_type: gauge
Expand All @@ -140,4 +141,5 @@
- name: database.uptime.sec
type: long
unit: s
metric_type: gauge
description: Delta count of the time in seconds the instance has been running.

0 comments on commit 69bfb75

Please sign in to comment.