Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: Fix lingering type issues #828

Merged
merged 4 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions collector/pg_postmaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const postmasterSubsystem = "postmaster"

func init() {
registerCollector(postmasterSubsystem, defaultEnabled, NewPGPostmasterCollector)
registerCollector(postmasterSubsystem, defaultDisabled, NewPGPostmasterCollector)
}

type PGPostmasterCollector struct {
Expand All @@ -44,7 +44,7 @@ var (
[]string{}, nil,
)

pgPostmasterQuery = "SELECT pg_postmaster_start_time from pg_postmaster_start_time();"
pgPostmasterQuery = "SELECT extract(epoch from pg_postmaster_start_time) from pg_postmaster_start_time();"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be better to change our var to a sql.NullTime, but if we're pushing changes to this collector to another set of changes, this is fine for now. I opened #830 to track.

)

func (c *PGPostmasterCollector) Update(ctx context.Context, instance *instance, ch chan<- prometheus.Metric) error {
Expand Down
2 changes: 1 addition & 1 deletion collector/pg_process_idle.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (PGProcessIdleCollector) Update(ctx context.Context, instance *instance, ch
var applicationName sql.NullString
var secondsSum sql.NullInt64
var secondsCount sql.NullInt64
var seconds []int64
var seconds []uint64
var secondsBucket []uint64

err := row.Scan(&applicationName, &secondsSum, &secondsCount, &seconds, &secondsBucket)
Expand Down