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

Please consider a big refactor (including renaming probably) for this package before marking stable. #9818

Open
atoulme opened this issue Mar 22, 2024 · 2 comments

Comments

@atoulme
Copy link
Contributor

atoulme commented Mar 22, 2024

          Please consider a big refactor (including renaming probably) for this package before marking stable.

Originally posted by @bogdandrutu in #9805 (comment)

@bogdandrutu
Copy link
Member

bogdandrutu commented Mar 22, 2024

  1. I think the "client" name of the package is too generic and confusing;
  2. Some (if not all) of this can be part of the consumer package since it is "propagated" via context between consumers;
  3. Better understand why we need to propagate any of these objects for the entire collector. Can some be "component" specific?

@TylerHelmuth
Copy link
Member

If we move this to consumer we'd be adding a direct dependency between confighttp/configgrpc and consumer, but I think thats ok. Considering the functionality within client exists to help share context between components I think this makes sense.

When we do the move we can expand some of the naming to include the keyword Connection. So Info could become ConnectionInfo, Addr becomes ConnectionAddr, Auth becomes ConnectionAuth, and Metadata becomes ConnectionMetadata. It is kinda verbose, but directly conveys what the struct represents. NewContext can potentially become NewContextWithConnectionInfo.

I would prefer not to restrict the Info struct to any specific component type. We don't restrict how components make connections, so I think it is valid for any component to be allowed to add its connection to the context and pass it own down the component pipeline. It should also be valid for any component to ask if there is an Info struct in the current ctx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

3 participants