Skip to content

feat(GKE): add sample for using GKE Managed OpenTelemetry#925

Open
giuliano-sider wants to merge 1 commit intoterraform-google-modules:mainfrom
giuliano-sider:main
Open

feat(GKE): add sample for using GKE Managed OpenTelemetry#925
giuliano-sider wants to merge 1 commit intoterraform-google-modules:mainfrom
giuliano-sider:main

Conversation

@giuliano-sider
Copy link

@giuliano-sider giuliano-sider commented Feb 4, 2026

Description

This adds a Terraform config sample for enabling GKE Managed OpenTelemetry.

Checklist

Readiness

  • [ X ] Yes, merge this PR after it is approved

Style

Testing

Intended location

API enablement

  • If the sample needs an API enabled to pass testing, I have added the service to the Test setup file

Review

  • If this sample adds a new directory, I have added codeowners to the CODEOWNERS file

@giuliano-sider giuliano-sider requested review from a team as code owners February 4, 2026 16:45
@snippet-bot
Copy link

snippet-bot bot commented Feb 4, 2026

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

required_providers {
google-beta = {
source = "hashicorp/google-beta"
version = "~> 7.17.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to pessimistic pin to the patch, or is the minor version sufficient?

Suggested change
version = "~> 7.17.0"
version = "~> 7.17"

Copy link
Author

Choose a reason for hiding this comment

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

I actually meant to use a minimum version for the google-beta provider (fixed now).

@apeabody
Copy link
Contributor

apeabody commented Feb 4, 2026

/gcbrun

@iennae
Copy link
Contributor

iennae commented Feb 4, 2026

/gcbrun

Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @giuliano-sider!

Please complete the "Location" in the Checklist.

before running the code snippet.
*/
# [START gke_standard_regional_with_managed_otel]
terraform {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

There's an exception for google-beta in https://googlecloudplatform.github.io/samples-style-guide/#language-specific; Ideally all new samples that require google-beta will have these requirements removed once the functionality moves to GA, but this format ensures it works today.

}
}

output "otel-enabled" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

The terraform and output blocks are encouraged by https://googlecloudplatform.github.io/samples-style-guide/. Should we clarify the different requirements in this repo mentioned in https://github.com/terraform-google-modules/terraform-docs-samples/blob/main/CONTRIBUTING.md#code-style?

Copy link
Contributor

@apeabody apeabody Feb 5, 2026

Choose a reason for hiding this comment

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

Thoughts @glasnt?

Copy link
Author

Choose a reason for hiding this comment

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

I added the GCP docs location for where to use this sample.

Should I just drop the terraform and output blocks then? I think they're useful, but if the repo style guide forbids them, I'll just edit them out.

Copy link
Contributor

Choose a reason for hiding this comment

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

Per earlier comment, because this resource currently requires a minimum google-beta provider, keep that block.

I'm not sure what purpose the output block here has, other than confirming configuration success. If the output was a generated value that the user needed to gather for further operations, I could understand it's inclusion, but in this case, if the Terraform applies correctly, this doesn't need to be confirmed with the output block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants