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

[chore][extension/observer] move extension observer to internal pkg and pass checkapi #29083

Closed
sakulali opened this issue Nov 9, 2023 · 4 comments
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage Stale

Comments

@sakulali
Copy link
Contributor

sakulali commented Nov 9, 2023

Component(s)

extension/observer

Is your feature request related to a problem? Please describe.

Function observer.NewEndpointsWatcher is referenced by the dockerobserver, ecstaskobserver, hostobserver and k8sobserver components. Since this is an exported function which is not allow for checkapi tool, we can extract that and place it in an internal/observer or pkg/observer package. When use checkapi tool(go run cmd/checkapi/main.go .), error as shown below:

2023/11/09 20:46:02 extension/observer does not define a NewFactory function
exit status 1

Describe the solution you'd like

Before the adjustment, the directory structure:
extension/observer
├── Makefile
├── README.md
├── dockerobserver/
├── ecsobserver/
├── ecstaskobserver/
├── endpoints.go
├── endpoints_test.go
├── endpointswatcher.go
├── endpointswatcher_test.go
├── go.mod
├── go.sum
├── hostobserver/
├── k8sobserver/
├── metadata.yaml
└── observer.go

After the adjustment, the directory structure (add new directory internal/observer):
extension/observer
├── README.md
├── dockerobserver/
├── ecsobserver/
├── ecstaskobserver/
├── hostobserver/
├── k8sobserver/
└── metadata.yaml

internal/observer
├── Makefile
├── endpoints.go
├── endpoints_test.go
├── endpointswatcher.go
├── endpointswatcher_test.go
├── go.mod
├── go.sum
├── metadata.yaml
└── observer.go

Describe alternatives you've considered

No response

Additional context

No response

@sakulali sakulali added enhancement New feature or request needs triage New item requiring triage labels Nov 9, 2023
@sakulali
Copy link
Contributor Author

sakulali commented Nov 9, 2023

I found maybe we can just assign an exported function to a global variable and pass checkapi(ensure that multiple goroutines do not access concurrently), just wait for #28886 merged

@sakulali sakulali closed this as completed Nov 9, 2023
@sakulali sakulali changed the title [chore][extension/observer] move extension observer to internal pkg and pass checkapi [chore][extension/observer] move extension observer to internal pkg and pass checkapi(Assigning a function to a global variable is a simple approach) Nov 9, 2023
@sakulali sakulali changed the title [chore][extension/observer] move extension observer to internal pkg and pass checkapi(Assigning a function to a global variable is a simple approach) [chore][extension/observer] move extension observer to internal pkg and pass checkapi Nov 30, 2023
@sakulali
Copy link
Contributor Author

Move to internal package seems more reasonable as comment #29321 (comment), so reopen this issue.

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage Stale
Projects
None yet
Development

No branches or pull requests

1 participant