-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Description
Use Case
Thanks for taking the time to review this feature request!
Right now, the outputs.stackdriver plugin relies on environment variables like GOOGLE_APPLICATION_CREDENTIALS or default credential paths. That works, but it’s not always practical—especially in setups where we’re running Telegraf in containers or juggling multiple environments.
What we’re asking for is an option to specify a credentials_file path directly in the Telegraf configuration. This would make things way easier to manage and clearer to implement.
Expected behavior
Here’s what we’d like to see:
A credentials_file parameter in the outputs.stackdriver plugin that lets us point to the path of the Google Cloud service account JSON file.
If this parameter is defined, it should take priority over environment variables or default credential paths.
Actual behavior
As of now, outputs.stackdriver doesn’t allow this. It only works with environment variables GOOGLE_APPLICATION_CREDENTIALS or Google’s default locations. That’s fine in some cases but becomes a pain in containerized environments or when managing multiple deployments. Additionally, leveraging the default locations has proved problematic when end user devices already use that location for their own Google auth.
Additional info
This appears to be implimented in a similar Google plugin: outputs.cloud_pubsub
## Optional. Filepath for GCP credentials JSON file to authorize calls to
## PubSub APIs. If not set explicitly, Telegraf will attempt to use
## Application Default Credentials, which is preferred.
# credentials_file = "path/to/my/creds.json"