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

Support for credentials_file Parameter in outputs.stackdriver Plugin #16326

Open
crflanigan opened this issue Dec 17, 2024 · 1 comment
Open
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@crflanigan
Copy link
Contributor

crflanigan commented Dec 17, 2024

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"
@crflanigan crflanigan added the feature request Requests for new plugin and for new features to existing plugins label Dec 17, 2024
@srebhan
Copy link
Member

srebhan commented Dec 18, 2024

@crflanigan makes sense to me. Feel free to submit a PR adding this feature. ;-)

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

No branches or pull requests

2 participants