Skip to content

Commit

Permalink
docs: add timestamp/parseTime snippet (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
burningalchemist authored Dec 12, 2024
1 parent a6ca845 commit 9592c14
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,19 @@ In case, you connect to a data warehouse (e.g. Snowflake) you don't want to keep
cost), you might want to disable `ping` by setting `enable_ping: false`.
</details>

<details>
<summary>Scraping timestamp value from the result set</summary>

Some database drivers by default return DATE or DATETIME values as String type, whereas sql_exporter expects it to be Time.

This may result in the following error:
```
unsupported Scan, storing driver.Value type []uint8 into type *time.Time
```

To resolve the issue, make sure to include `parseTime=true` as a parameter on the DSN, so values with TIMESTAMP, DATETIME, TIME, DATE types
will end up as `time.Time` type, which is a requirement on the sql_exporter side to process the value correctly.
</details>

<details>
<summary>Using AWS Secrets Manager</summary>
Expand Down

0 comments on commit 9592c14

Please sign in to comment.