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

postgresql output support secretstores #14290

Closed
yoon-sunghyun-fnblock opened this issue Nov 14, 2023 · 5 comments · Fixed by #15041
Closed

postgresql output support secretstores #14290

yoon-sunghyun-fnblock opened this issue Nov 14, 2023 · 5 comments · Fixed by #15041
Labels
area/postgresql feature request Requests for new plugin and for new features to existing plugins

Comments

@yoon-sunghyun-fnblock
Copy link

Use Case

telegraf.conf

[[secretstores.http]]
  id = "meta_conf"
  url = "http://localhost/meta/META_DB"
[[outputs.postgresql]]  
  connection = "host=@{meta_conf:host} port=@{meta_conf:port} user=@{meta_conf:user} password=@{meta_conf:password} sslmode=disable dbname=@{meta_conf:database}"

Expected behavior

Secretstores available in postgresql output

example>

http://localhost/meta/META_DB

{"host":"0.0.0.0","user":"postgres","password":"postgres","port":"5432","database":"postgres"}

Assuming the API is the above value, the value is stored in secretstores.

Actual behavior

The secretstores value is substituted into the setting value.

[[outputs.postgresql]]  
  connection = "host=0.0.0.0 port=5432 user=postgres password=postgres sslmode=disable dbname=postgres"

Additional info

No response

@yoon-sunghyun-fnblock yoon-sunghyun-fnblock added the feature request Requests for new plugin and for new features to existing plugins label Nov 14, 2023
@powersj
Copy link
Contributor

powersj commented Nov 30, 2023

next steps: looking at adding this similar to other sql plugins. However, we would only land this once the secret store initialization change goes in to avoid impacting other plugins or users who are not using secret store.

@powersj
Copy link
Contributor

powersj commented Mar 22, 2024

@yoon-sunghyun-fnblock,

I have put up #15041 with the ability to use secret stores as a part of the connection option. Can you please give that a try and let me know if it resolves your request?

Thanks

@powersj powersj added the waiting for response waiting for response from contributor label Mar 22, 2024
@yoon-sunghyun-fnblock
Copy link
Author

@powersj

Are you saying to use this to modify the source?

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Mar 25, 2024
@powersj
Copy link
Contributor

powersj commented Mar 25, 2024

Hi @yoon-sunghyun-fnblock,

You can download artifacts that you can try out directly from this comment: #15041 (comment)

@powersj powersj added the waiting for response waiting for response from contributor label Mar 25, 2024
@yoon-sunghyun-fnblock
Copy link
Author

@powersj

It's perfect. Confirmed that it is working properly. secretstores.http to receive information and use it for connection.
I appreciate it.

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Mar 26, 2024
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

Successfully merging a pull request may close this issue.

3 participants