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

docs: add timestamp/parseTime snippet #657

Merged
merged 1 commit into from
Dec 12, 2024
Merged
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
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
Loading