opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[opampextension]: Move custom message interface to separate module

Open BinaryFissionGames opened this issue 9 months ago • 5 comments

Description: <Describe what has changed.>

  • Breaks our the custom message interface to a separate module, so other components can use the interface without needing to import the opampextension module in its entirety.

We could temporarily alias the old methods if we'd like, but I think that the CustomMessage stuff has been so short lived that, in addition to the alpha status of the opampextension component, it feels justified to just skip the deprecation process and move it to a new module.

Link to tracking Issue: Closes #32950

Testing:

  • Covered by existing unit tests

Documentation:

  • Added more documentation on usage in the new module.
  • Modified opampextension docs to point to the new module.

BinaryFissionGames avatar May 08 '24 20:05 BinaryFissionGames

@BinaryFissionGames Could we put this in pkg and make it just a module instead of an extension? Usually extensions are supposed to export a component that gets put into the service, as where modules in the pkg directory are only intended to be used as libraries.

evan-bradley avatar May 09 '24 19:05 evan-bradley

@BinaryFissionGames Could we put this in pkg and make it just a module instead of an extension? Usually extensions are supposed to export a component that gets put into the service, as where modules in the pkg directory are only intended to be used as libraries.

I'm certainly open to it. The reason I chose not to is based on the storage module: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/storage

It also mirrors in the non-contrib repo how the storage package is also nested under extension: https://github.com/open-telemetry/opentelemetry-collector/tree/main/extension/experimental/storage

And also the auth module, which contains the authcation extension interfaces: https://github.com/open-telemetry/opentelemetry-collector/tree/main/extension/auth

So it seemed like this was the current pattern.

Still happy to change it if you think I should.

BinaryFissionGames avatar May 09 '24 19:05 BinaryFissionGames

Encoding seems like another example of a module that is not component that's nested under extension: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/encoding

BinaryFissionGames avatar May 09 '24 19:05 BinaryFissionGames

Thanks for the examples. I haven't dug into those extensions too much, I didn't know they exported interfaces as well. I'd say you have it right putting it under extension, let's leave it as-is.

As a side note, thanks for being mindful of the deprecation process; I agree that we can just move the interfaces as part of a breaking change like you've done here.

evan-bradley avatar May 09 '24 20:05 evan-bradley

You'll need to add this module to cmd/checkapi/allowlist.txt since we're exporting more than just a NewFactory function.

evan-bradley avatar May 09 '24 20:05 evan-bradley