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

Add timestamp option to postgres_extensible to handle log like queries. #8601

Closed
tfoldi opened this issue Dec 20, 2020 · 1 comment
Closed
Labels
area/postgresql feature request Requests for new plugin and for new features to existing plugins

Comments

@tfoldi
Copy link
Contributor

tfoldi commented Dec 20, 2020

Feature Request

Add timestamp option to postgres_extensible to handle log like queries.

I am about to send a PR, so you do not have to implement it - just don't hate that much

Proposal:

add timestamp option for query configuration such as:

  ## Structure :
  ## [[inputs.postgresql_extensible.query]]
  ##   sqlquery string
  ##   version string
  ##   withdbname boolean
  ##   tagvalue string (comma separated)
  ##   measurement string
  ##   timestamp string

in case timestamp column is defined, then the data point's timestamp will be parsed from that database column. If not specified, it will be as of today, using the current time.

Current behavior:

The data point's timestamp is always the current time.

Desired behavior:

Give users the possibility to decide if the timestamp can be retrieved from a column (just as you can do it for tag_set).

Use case:

Many apps log their actions into databases. In that case, each log line will be associated with the log insertion time instead of query execution time.

Simple use case, I want to quantify my Redshift Spectrum unload executions. The table definition is: https://docs.aws.amazon.com/redshift/latest/dg/r_STL_UNLOAD_LOG.html . If I want to check how many rows were inserted at what time, I need end_time as timestamp in my data point.

@tfoldi tfoldi added the feature request Requests for new plugin and for new features to existing plugins label Dec 20, 2020
@sjwang90
Copy link
Contributor

Closed in #8602

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/postgresql feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

3 participants