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

feat(outputs.stackdriver): Ensure quota is charged to configured project #16583

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

crflanigan
Copy link
Contributor

@crflanigan crflanigan commented Mar 4, 2025

  • Updated Stackdriver output plugin to use the project field from the Telegraf configuration for quota attribution via option.WithQuotaProject(s.Project).
  • Ensures that metric ingestion quota is billed to the destination project rather than the service account’s project.
  • This allows sending metrics to multiple projects while ensuring that each project is responsible for its own quota, instead of charging all usage to the service account’s project.
  • Preserves existing behavior while improving clarity and correctness in quota handling.

Summary

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16584

- Updated Stackdriver output plugin to use the `project` field from the Telegraf configuration
  for quota attribution via `option.WithQuotaProject(s.Project)`.
- Ensures metric ingest quota is billed to the correct destination project instead of the
  scoping project's service account.
- Preserves existing behavior while improving clarity and correctness in quota handling.
@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Mar 4, 2025
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Mar 4, 2025

@srebhan srebhan changed the title feat(stackdriver): Ensure quota is charged to configured project feat(outputs.stackdriver): Ensure quota is charged to configured project Mar 7, 2025
@telegraf-tiger telegraf-tiger bot added the plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins label Mar 7, 2025
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @crflanigan! Just a single comment...

Comment on lines +6 to +14
## Quota Project
## Specifies the Google Cloud project that should be charged for metric ingestion quota.
## If omitted, the quota is charged to the project associated with the service account.
## This is useful when sending metrics to multiple projects using a single service account,
## ensuring that the target projects are billed instead of the service account's project.
##
## The caller must have the `serviceusage.services.use` permission on the specified quota project.
# quota_project = "billing-project"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default is empty isn't it? So how about shortening this to

Suggested change
## Quota Project
## Specifies the Google Cloud project that should be charged for metric ingestion quota.
## If omitted, the quota is charged to the project associated with the service account.
## This is useful when sending metrics to multiple projects using a single service account,
## ensuring that the target projects are billed instead of the service account's project.
##
## The caller must have the `serviceusage.services.use` permission on the specified quota project.
# quota_project = "billing-project"
## Quota Project to charge for metric ingestion quota
## If omitted, the quota is charged to the project associated with the service account.
## The caller must have the `serviceusage.services.use` permission on the specified quota project.
# quota_project = ""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! So I guess the only concern I would have is that we removed the explanation as to what this would be used for, sending to multiple projects using a single SA while pointing the quota at the destination project instead of the SA project.

How about this?

## Quota Project
## Specifies the Google Cloud project that should be billed for metric ingestion.
## If omitted, the quota is charged to the service account’s default project.
## This is useful when sending metrics to multiple projects using a single service account.
## The caller must have the `serviceusage.services.use` permission on the specified project.
# quota_project = ""

@srebhan srebhan self-assigned this Mar 7, 2025
@srebhan srebhan added the area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver label Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gcp Google Cloud plugins including cloud_pubsub, cloud_pubsub_push, stackdriver feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins
Projects
None yet
Development

Successfully merging this pull request may close these issues.

outputs.stackdriver - Scope Quota Costs to the Destination Google Project instead of SA Project
2 participants