Skip to content

Feat/mysql metrics support#206

Merged
Dhanrajkshirsagar merged 14 commits into
mainfrom
feat/mysql-metrics-support
Jun 27, 2026
Merged

Feat/mysql metrics support#206
Dhanrajkshirsagar merged 14 commits into
mainfrom
feat/mysql-metrics-support

Conversation

@Dhanrajkshirsagar

@Dhanrajkshirsagar Dhanrajkshirsagar commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Dhanraj and others added 14 commits May 24, 2026 01:41
Split hostlink-archive into separate definitions for hostlink (linux-only
with scripts) and hlctl (multi-platform), fixing goreleaser exit code 1
caused by mixed-platform builds in a single archive. Also revert
checkout/setup-go to v4/v5 as v6 tags do not exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Hostlink agent was sending metrics with type "traefik.service" but the
Rails control plane expects type "traefik.proxy". Align the metric type
constant to match the backend schema so Traefik proxy metrics are properly
stored and surfaced in the project metrics endpoint.
…lify UUID

The naming resolver prioritized coolify.name first, but Coolify sets this to
resource UUIDs (e.g. vec1dkp79uhxwb8zacdijtcc) which aren't user-friendly.
Docker Compose service names (com.docker.compose.service) produce readable
names like postgres, traefik, or soketi.

Priority order is now:
1. com.docker.compose.service label
2. coolify.name label
3. Docker container name
4. Truncated container ID
Traefik v3.6 on Coolify only exposes entrypoint-level Prometheus metrics
(traefik_entrypoint_requests_total, traefik_entrypoint_request_duration_seconds_*)
with the 'entrypoint' label, not service-level metrics.

- Rename TraefikServiceMetrics -> TraefikEntrypointMetrics
- Rename TraefikServiceAttributes -> TraefikEntrypointAttributes (service_name -> entrypoint_name)
- Match traefik_entrypoint_* metric names instead of traefik_service_*
- Group by 'entrypoint' label instead of 'service'
Align MySQLDatabaseMetrics JSON keys and add missing metrics:

Renamed to match Rails VALID_METRICS keys:
- threads_connected -> connections_total
- innodb_cache_hit_ratio -> innodb_buffer_pool_hit_ratio
- slow_queries (cumulative) -> slow_queries_per_second (delta rate)

Added:
- connections_aborted (from Aborted_connects)
- threads_running (active query load indicator)
- innodb_row_lock_waits_per_second (lock contention)
- tmp_disk_tables_per_second (queries spilling to disk)
- select_full_scans_per_second (missing index / full table scan detection)

All new rate metrics use the same delta-over-elapsed pattern as QPS.
First collection returns 0.0 for all rate metrics (consistent with
PostgreSQL collector behaviour).

Add collector_test.go covering delta rate logic, hit ratio
calculation, and parser helpers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Conflicts were all in the Traefik router metrics feature added to main
after this branch was cut. Kept both sides: our entrypoint improvements
and main's router-level metrics (CollectRouters, RouterMetricSet,
MetricTypeTraefikRouter, TraefikRouterMetrics, TraefikRouterAttributes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Dhanrajkshirsagar Dhanrajkshirsagar merged commit 19c17aa into main Jun 27, 2026
1 check passed
@Dhanrajkshirsagar Dhanrajkshirsagar deleted the feat/mysql-metrics-support branch June 27, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant