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

Update OTel libraries to v0.100.0 #208

Merged
merged 13 commits into from
May 22, 2024
Merged

Update OTel libraries to v0.100.0 #208

merged 13 commits into from
May 22, 2024

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented May 21, 2024

Updating OpenTelemetry to v0.100.0. This involved the following changes:

  • Upgrade version of Go to 1.21
  • Use component.Type instead of string for creating new components in factories
  • Use new name for confignet types [confignet] Should we change the name of NetAddr and NetTCP to end in Config? open-telemetry/opentelemetry-collector#9509
  • Use new go.opentelemetry.io location for mdatagen package
  • Delete our copies of googlemanagedprometheusexporter and prometheusreceiver and pull the upstream versions instead
  • Adjust metadata.yaml files to use type instead of name and include stability
  • Regenerate internal/metadata packages and adjust to new APIs (this has been skipped a couple releases in the GPU receivers due to a bad make target so the changes were more substantial there)
  • Switch loggingexporter to debugexporter as loggingexporter is deprecated and will be deleted soon
  • Can't use the new generated_component_test.go files in the GPU receivers, instead make a copy of them and use the proper build tags
  • Small incongruencies with links in comments for context

.gitignore Outdated

# GPU receiver generated component tests

# These generated test files do not work with the default off build tag setup
Copy link
Member

Choose a reason for hiding this comment

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

Is this considered breakage? Something OTel plans to fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a breakage. We do a very atypical pattern here. We could probably rearchitect it but to just get one unit test to pass I'm not convinced it's worth it. If we do ever decide to build otelopscol with the OpenTelemetry Collector Builder instead in the future we may be able to come up with a better way, but decided this was easier for now.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, the current phrasing confused me. Maybe something like:

# These generated test files were not designed to work with the "default off"
# build tag approach we use for the GPU receivers. As such…

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rephrased in 0e95bd9

Makefile Outdated Show resolved Hide resolved
.github/header-checker-lint.yml Show resolved Hide resolved
go 1.20
go 1.21

toolchain go1.21.9
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, presubmit.yml uses 1.21.10. Should it be consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

toolchain directive represents the minimum required, so this doesn't provide any negatives. I was using a 1.21.9 toolchain when I made this update so that's why it kept getting automatically added here. Realistically it could probably be changed to 1.21.0 because we don't care about the particular patch version

Copy link
Member

Choose a reason for hiding this comment

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

I'm just wondering if we should be testing with the minimum version we require…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this toolchain to be go1.21.10 since we might as well just stay consistent with the latest 1.21 available. Done in f224b1b

@@ -59,7 +60,7 @@ func (c *Config) Validate() error {
err = multierr.Append(err, errors.New("password provided without user"))
}

if _, tlsErr := c.LoadTLSConfig(); tlsErr != nil {
if _, tlsErr := c.LoadTLSConfig(context.TODO()); tlsErr != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why not context.Background()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following the recommendations of this go-staticcheck warning. Realistically it does not make a difference, as the context in this function is an _ arg.

Copy link
Member

Choose a reason for hiding this comment

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

To me, context.TODO() implies "revisit later and replace with a proper context". Given your second sentence, context.Background() sounds like the proper context (same as context.TODO(), but without the implications), but up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in 37653b1

receiver/mongodbreceiver/factory.go Show resolved Hide resolved
receiver/dcgmreceiver/factory.go Outdated Show resolved Hide resolved
receiver/dcgmreceiver/metadata.yaml Outdated Show resolved Hide resolved
.github/header-checker-lint.yml Outdated Show resolved Hide resolved
receiver/varnishreceiver/factory.go Outdated Show resolved Hide resolved
Copy link
Member

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

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

Forgot one, sorry.

// limitations under the License.

//go:build gpu
// +build gpu
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to add a comment here that this file is basically the generated test with the build tag added? Ditto for receiver/nvmlreceiver/component_test.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 84e7ae5

Copy link
Member

@igorpeshansky igorpeshansky left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@braydonk braydonk merged commit 7bd7fec into master May 22, 2024
7 checks passed
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.

2 participants