Skip to content

Commit

Permalink
chore: merge pull request #4
Browse files Browse the repository at this point in the history
feature/prometheus
  • Loading branch information
3n0ugh authored Oct 26, 2024
2 parents 03a6804 + 9a4fc1e commit adf58c7
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 839 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ func Handler(ctx *replication.ListenerContext) {

* [Simple](./example/simple)
* [Simple File Config](./example/simple-file-config)
* [PostgreSQL to Elasticsearch](./example/elasticsearch)
* [PostgreSQL to Kafka](./example/kafka)
* [PostgreSQL to Elasticsearch](https://github.com/Trendyol/go-pq-cdc-elasticsearch/tree/main/example/simple)
* [PostgreSQL to Kafka](https://github.com/Trendyol/go-pq-cdc-kafka/tree/main/example/simple)
* [PostgreSQL to PostgreSQL](./example/postgresql)

### Availability
Expand Down Expand Up @@ -167,19 +167,19 @@ This setup ensures continuous data synchronization and minimal downtime in captu
The client collects relevant metrics related to PostgreSQL change data capture (CDC) and makes them available at
the `/metrics` endpoint.

| Metric Name | Description | Labels | Value Type |
|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------|-----------|------------|
| go_pq_cdc_update_total | The total number of `UPDATE` operations captured on specific tables. | slot_name | Counter |
| go_pq_cdc_delete_total | The total number of `DELETE` operations captured on specific tables. | slot_name | Counter |
| go_pq_cdc_insert_total | The total number of `INSERT` operations captured on specific tables. | slot_name | Counter |
| go_pq_cdc_cdc_latency_current | The current latency in capturing data changes from PostgreSQL. | slot_name | Gauge |
| go_pq_cdc_process_latency_current | The current latency in processing the captured data changes. | slot_name | Gauge |
| go_pq_cdc_replication_slot_slot_confirmed_flush_lsn | The last confirmed flush Log Sequence Number (LSN) in the PostgreSQL replication slot. | slot_name | Gauge |
| go_pq_cdc_replication_slot_slot_current_lsn | The current Log Sequence Number (LSN) being processed in the PostgreSQL replication slot. | slot_name | Gauge |
| go_pq_cdc_replication_slot_slot_is_active | Indicates whether the PostgreSQL replication slot is currently active (1 for active, 0 for inactive). | slot_name | Gauge |
| go_pq_cdc_replication_slot_slot_lag | The replication lag measured by the difference between the current LSN and the confirmed flush LSN. | slot_name | Gauge |
| go_pq_cdc_replication_slot_slot_retained_wal_size | The size of Write-Ahead Logging (WAL) files retained for the replication slot in bytes. | slot_name | Gauge |
| runtime metrics | [Prometheus Collector](https://golang.bg/src/runtime/metrics/description.go) | N/A | N/A |
| Metric Name | Description | Labels | Value Type |
|-----------------------------------------------------|-------------------------------------------------------------------------------------------------------|----------------|------------|
| go_pq_cdc_update_total | The total number of `UPDATE` operations captured on specific tables. | slot_name, host| Counter |
| go_pq_cdc_delete_total | The total number of `DELETE` operations captured on specific tables. | slot_name, host| Counter |
| go_pq_cdc_insert_total | The total number of `INSERT` operations captured on specific tables. | slot_name, host| Counter |
| go_pq_cdc_cdc_latency_current | The current latency in capturing data changes from PostgreSQL. | slot_name, host| Gauge |
| go_pq_cdc_process_latency_current | The current latency in processing the captured data changes. | slot_name, host| Gauge |
| go_pq_cdc_replication_slot_slot_confirmed_flush_lsn | The last confirmed flush Log Sequence Number (LSN) in the PostgreSQL replication slot. | slot_name, host| Gauge |
| go_pq_cdc_replication_slot_slot_current_lsn | The current Log Sequence Number (LSN) being processed in the PostgreSQL replication slot. | slot_name, host| Gauge |
| go_pq_cdc_replication_slot_slot_is_active | Indicates whether the PostgreSQL replication slot is currently active (1 for active, 0 for inactive). | slot_name, host| Gauge |
| go_pq_cdc_replication_slot_slot_lag | The replication lag measured by the difference between the current LSN and the confirmed flush LSN. | slot_name, host| Gauge |
| go_pq_cdc_replication_slot_slot_retained_wal_size | The size of Write-Ahead Logging (WAL) files retained for the replication slot in bytes. | slot_name, host| Gauge |
| runtime metrics | [Prometheus Collector](https://golang.bg/src/runtime/metrics/description.go) | N/A | N/A |

### Grafana Dashboard

Expand Down
80 changes: 0 additions & 80 deletions example/elasticsearch/docker-compose.yml

This file was deleted.

30 changes: 0 additions & 30 deletions example/elasticsearch/go.mod

This file was deleted.

64 changes: 0 additions & 64 deletions example/elasticsearch/go.sum

This file was deleted.

Loading

0 comments on commit adf58c7

Please sign in to comment.