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

Resource for Cloud Logging saved queries? #18023

Open
michaelbannister opened this issue May 4, 2024 · 1 comment
Open

Resource for Cloud Logging saved queries? #18023

michaelbannister opened this issue May 4, 2024 · 1 comment
Labels
Milestone

Comments

@michaelbannister
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Description

I'm not sure if this is a recently-added feature but in Cloud Logging when you save a query you have the option to "share with project". This corresponds to setting {{visibility: SHARED}} in the SavedQuery resource

I'm in a platform team – we have 100+ engineering teams with GCP projects we've provisioned for them, and it'd be useful for us to provision some standard shared queries into their projects through our Terraform configuration.

It probably wouldn't make sense to provision a non-shared query through Terraform, so you might set that by default.

New or Affected Resource(s)

  • google_logging_project_saved_query

Potential Terraform Configuration

resource "google_logging_project_saved_query" "app_errors" {
  display_name = "Kubernetes Job logs"
  description = "Only Job logs from your Kubernetes namespace"
  logging_query {
    filter = <<EOF
resource.type=k8s_container
-resource.labels.container_name="istio-proxy"
-resource.labels.container_name=istio-validation"
EOF
  }
  summary_fields = [
    "labels/\"k8s-pod/job-name\"" # awkward quoting here
  ]
}

References

No response

@github-actions github-actions bot added forward/review In review; remove label to forward service/logging labels May 4, 2024
@michaelbannister
Copy link
Contributor Author

(could add a log_analytics_query option later when that's out of preview – ref)

@BBBmau BBBmau added this to the Goals milestone May 6, 2024
@BBBmau BBBmau added the size/m label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants