Skip to content

Support for credentials_file Parameter in outputs.stackdriver Plugin #16326

@crflanigan

Description

@crflanigan

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions