Skip to content

Several of the new collectors fail with incorrect data types #818

Closed
@sclu1034

Description

@sclu1034

What did you do?
Updated to v0.13.0 and removed queries.yaml in favor of the built-in collectors.

What did you expect to see?
An error-free log and the same metrics to be reported as before.

What did you see instead? Under which circumstances?

Repeating entries of the logs shown below and affected metrics, such as pg_postmaster_start_time_seconds, stopped being reported.
No special circumstances, I just started the tool via quay.io/prometheuscommunity/postgres-exporter:latest with the exact same setup as the previous image.

Environment

  • postgres_exporter version:
postgres_exporter, version 0.13.0 (branch: HEAD, revision: f550f8f8ad77e054f12eb3d3f6605edc037573f5)
  build user:       root@de207ed6b751
  build date:       20230622-07:05:45
  go version:       go1.20.5
  platform:         linux/amd64
  tags:             netgo static_build
  • postgres_exporter flags: Default Docker CMD line

  • PostgreSQL version: 15.3

  • Logs:

ts=2023-06-22T08:25:13.132Z caller=proc.go:250 msg="Excluded databases" databases=[]
ts=2023-06-22T08:25:13.142Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9187
ts=2023-06-22T08:25:13.142Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9187
ts=2023-06-22T08:25:17.855Z caller=server.go:74 level=info msg="Established new database connection" fingerprint=postgres:5432
ts=2023-06-22T08:25:17.860Z caller=collector.go:190 level=error msg="collector failed" name=process_idle duration_seconds=0.004954557 err="sql: Scan error on column index 3, name \"seconds\": unsupported Scan, storing driver.Value type []uint8 into type *[]int64"
ts=2023-06-22T08:25:17.861Z caller=postgres_exporter.go:622 level=info msg="Semantic version changed" server=postgres:5432 from=0.0.0 to=15.3.0
ts=2023-06-22T08:25:17.864Z caller=collector.go:190 level=error msg="collector failed" name=postmaster duration_seconds=0.008552172 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:17.865Z caller=collector.go:190 level=error msg="collector failed" name=stat_database duration_seconds=0.009474908 err="sql: Scan error on column index 1, name \"datname\": converting NULL to string is unsupported"
ts=2023-06-22T08:25:17.867Z caller=collector.go:190 level=error msg="collector failed" name=replication duration_seconds=0.011338687 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:32.855Z caller=collector.go:190 level=error msg="collector failed" name=replication duration_seconds=0.000977326 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:32.857Z caller=collector.go:190 level=error msg="collector failed" name=process_idle duration_seconds=0.002956973 err="sql: Scan error on column index 3, name \"seconds\": unsupported Scan, storing driver.Value type []uint8 into type *[]int64"
ts=2023-06-22T08:25:32.859Z caller=collector.go:190 level=error msg="collector failed" name=postmaster duration_seconds=0.00465972 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:32.859Z caller=collector.go:190 level=error msg="collector failed" name=stat_database duration_seconds=0.005185534 err="sql: Scan error on column index 1, name \"datname\": converting NULL to string is unsupported"
ts=2023-06-22T08:25:47.856Z caller=collector.go:190 level=error msg="collector failed" name=postmaster duration_seconds=0.001654959 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:47.857Z caller=collector.go:190 level=error msg="collector failed" name=replication duration_seconds=0.002426217 err="sql: Scan error on column index 0, name \"pg_postmaster_start_time\": converting driver.Value type time.Time (\"2023-06-19 13:22:47.713957 +0200 CEST\") to a float64: invalid syntax"
ts=2023-06-22T08:25:47.857Z caller=collector.go:190 level=error msg="collector failed" name=stat_database duration_seconds=0.00275669 err="sql: Scan error on column index 1, name \"datname\": converting NULL to string is unsupported"
ts=2023-06-22T08:25:47.859Z caller=collector.go:190 level=error msg="collector failed" name=process_idle duration_seconds=0.004420991 err="sql: Scan error on column index 3, name \"seconds\": unsupported Scan, storing driver.Value type []uint8 into type *[]int64"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions