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

[processor/resourcedetection] Add support for Bare Metal Solution GCP platform #32985

Merged
merged 5 commits into from May 15, 2024

Conversation

ghost
Copy link

@ghost ghost commented May 10, 2024

Description: Add support for Bare Metal Solution platform to the GCP resourcedetection processor

FYI I had to place the check for gcp.BareMetalSolution before !metadata.OnGCE() because the latter fails on Bare Metal Solution due to the absence of a metadata server.

Link to tracking Issue:

Testing: unit tests updated

Documentation:

@ghost ghost requested review from Aneurysm9 and dashpole as code owners May 10, 2024 16:48
@ghost ghost self-requested a review May 10, 2024 16:48
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label May 10, 2024
Copy link
Contributor

@dashpole dashpole left a comment

Choose a reason for hiding this comment

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

Looks like this still needs tests

@ghost
Copy link
Author

ghost commented May 10, 2024

Looks like this still needs tests

Sure, what specific tests would you like me to implement?

@dashpole
Copy link
Contributor

Sure, what specific tests would you like me to implement?

You should add a case similar to other platforms, e.g.:

{
desc: "Cloud Run",
detector: newTestDetector(&fakeGCPDetector{
projectID: "my-project",
cloudPlatform: gcp.CloudRun,
faaSID: "1472385723456792345",
faaSCloudRegion: "us-central1",
faaSName: "my-service",
faaSVersion: "123456",
}),
expectedResource: map[string]any{
conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP,
conventions.AttributeCloudAccountID: "my-project",
conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPCloudRun,
conventions.AttributeCloudRegion: "us-central1",
conventions.AttributeFaaSName: "my-service",
conventions.AttributeFaaSVersion: "123456",
conventions.AttributeFaaSInstance: "1472385723456792345",
},
},

@ghost
Copy link
Author

ghost commented May 13, 2024

You should add a case similar to other platforms, e.g.:

Done. PTAL ?

@dashpole
Copy link
Contributor

Looks like you still need to add a changelog entry. See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#changelog for how to do that.

@ghost
Copy link
Author

ghost commented May 14, 2024

I've added a changelog entry. PTAL ?

@dashpole dashpole added the ready to merge Code review completed; ready to merge by maintainers label May 14, 2024
@andrzej-stencel andrzej-stencel merged commit 289843b into open-telemetry:main May 15, 2024
160 of 161 checks passed
@github-actions github-actions bot added this to the next release milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/resourcedetection Resource detection processor ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants