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

[Resources.Gcp] Add Google Cloud Platform resource detector #1691

Merged
merged 44 commits into from
May 14, 2024

Conversation

matt-hensley
Copy link
Contributor

@matt-hensley matt-hensley commented Apr 24, 2024

Changes

Adds Google Cloud Platform resource detector. See package README for published resource attributes.

This package use the new namespace and extension method approach proposed in #1610.

A AddGcpDetector extension method is available for ResourceBuilder.

  • Appropriate CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

Copy link

codecov bot commented Apr 24, 2024

Codecov Report

Attention: Patch coverage is 72.54902% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 75.97%. Comparing base (71655ce) to head (bd37f89).
Report is 236 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1691      +/-   ##
==========================================
+ Coverage   73.91%   75.97%   +2.05%     
==========================================
  Files         267      297      +30     
  Lines        9615    11557    +1942     
==========================================
+ Hits         7107     8780    +1673     
- Misses       2508     2777     +269     
Flag Coverage Δ
unittests-Exporter.Geneva 64.22% <ø> (?)
unittests-Exporter.OneCollector 89.72% <ø> (?)
unittests-Extensions 79.33% <ø> (?)
unittests-Instrumentation.AspNet 74.39% <ø> (?)
unittests-Instrumentation.AspNetCore 85.27% <ø> (?)
unittests-Instrumentation.EventCounters 76.36% <ø> (?)
unittests-Instrumentation.GrpcNetClient 81.96% <ø> (?)
unittests-Instrumentation.Http 81.91% <ø> (?)
unittests-Instrumentation.Owin 83.43% <ø> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.Runtime 100.00% <ø> (?)
unittests-Instrumentation.SqlClient 90.90% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 71.00% <ø> (?)
unittests-Instrumentation.Wcf 78.47% <ø> (?)
unittests-PersistentStorage 65.78% <ø> (?)
unittests-ResourceDetectors.Azure 81.53% <ø> (?)
unittests-ResourceDetectors.Host 54.11% <ø> (?)
unittests-ResourceDetectors.Process 100.00% <ø> (?)
unittests-ResourceDetectors.ProcessRuntime 76.08% <ø> (?)
unittests-Resources.Gcp 72.54% <72.54%> (?)
unittests-Solution 79.13% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...etry.Resources.Gcp/GcpResourceBuilderExtensions.cs 0.00% <0.00%> (ø)
...OpenTelemetry.Resources.Gcp/GcpResourceDetector.cs 75.51% <75.51%> (ø)

... and 280 files with indirect coverage changes

# Conflicts:
#	opentelemetry-dotnet-contrib.sln
@matt-hensley matt-hensley marked this pull request as ready for review May 1, 2024 01:37
@matt-hensley matt-hensley requested a review from a team as a code owner May 1, 2024 01:37
Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

LGTM.

@CodeBlanch, could you please review public API?

# Conflicts:
#	.github/workflows/ci.yml
#	opentelemetry-dotnet-contrib.sln
using OpenTelemetry.Internal;
using OpenTelemetry.Resources.Gcp;

namespace OpenTelemetry.Resources;
Copy link
Member

Choose a reason for hiding this comment

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

Should extensions go into the namespace of the thing they are extending or somewhere else?

We have had debates about this in the past so I thought I would drop a comment here to make it known this was an intentional decision.

.NET guidelines say this:

image

I would argue these packages/extensions are all about dependency management for users so this gets a 👍 from me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most of the instrumentations put their extension methods in the namespace for the type they're extending (ex. OpenTelemetry.Trace, OpenTelemetry.Metrics), so would fit unless the other extension methods are going to be moved.

@CodeBlanch
Copy link
Member

The public API LGTM. This whole PR is very nicely done! I ❤️ using OpenTelemetry.Resources in the namespace and the package name.

I haven't approved just yet because I asked @alanwest to also take a look. Because he was originally leading the charge for better package names (open-telemetry/opentelemetry-dotnet#3469).

@alanwest
Copy link
Member

alanwest commented May 8, 2024

I ❤️ using OpenTelemetry.Resources in the namespace and the package name.

I don't mind if we change course on this, but is the plan to rename the existing packages to OpenTelemetry.Resources.*?

@Kielek
Copy link
Contributor

Kielek commented May 8, 2024

I ❤️ using OpenTelemetry.Resources in the namespace and the package name.

I don't mind if we change course on this, but is the plan to rename the existing packages to OpenTelemetry.Resources.*?

Yes. #1610

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

LGTM

@Kielek Kielek merged commit ec134bb into open-telemetry:main May 14, 2024
153 of 154 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:resources.gcp Things related to OpenTelemetry.Resources.Gcp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants