Skip to content

Fix epoch uint64 to string conversion in metrics labels#65

Merged
daniel-garcia merged 3 commits intov3from
copilot/sub-pr-64
Nov 19, 2025
Merged

Fix epoch uint64 to string conversion in metrics labels#65
daniel-garcia merged 3 commits intov3from
copilot/sub-pr-64

Conversation

Copy link

Copilot AI commented Nov 19, 2025

Addresses feedback from #64 on incorrect epoch conversion that interpreted uint64 values as Unicode code points instead of numeric strings.

Changes

  • Fixed RecordConnectionCount in observability/metrics.go to use strconv.FormatUint(epoch, 10) instead of string(rune(epoch))
  • Added strconv import

Example

// Before: epoch 1234 becomes garbage Unicode character
ConnectionsPerEpoch.WithLabelValues(connection, string(rune(epoch)))

// After: epoch 1234 becomes "1234"
ConnectionsPerEpoch.WithLabelValues(connection, strconv.FormatUint(epoch, 10))

This ensures Prometheus metric labels correctly display epoch values as decimal strings.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 19, 2025 21:44
Co-authored-by: daniel-garcia <366029+daniel-garcia@users.noreply.github.com>
Co-authored-by: daniel-garcia <366029+daniel-garcia@users.noreply.github.com>
Copilot AI changed the title [WIP] Update integration tests for libpq, pgx4, and pgx5 Fix epoch uint64 to string conversion in metrics labels Nov 19, 2025
Copilot AI requested a review from daniel-garcia November 19, 2025 21:46
@daniel-garcia daniel-garcia marked this pull request as ready for review November 19, 2025 22:49
@daniel-garcia daniel-garcia merged commit 329ad8a into v3 Nov 19, 2025
@daniel-garcia daniel-garcia deleted the copilot/sub-pr-64 branch November 19, 2025 22:49
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.

2 participants