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][receiver/sqlquery] Move reusable logic to internal package #30709

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

crobert-1
Copy link
Member

Description:

As noted in the related issues, a lot of the logic in the sqlquery receiver can be moved to a central package to be used by other receivers. I realize this appears to be a large change, but it's purely a re-organization PR, there's no functional changes. GitHub is not recognizing moved files, so please refer to new file names and their deleted counterparts. A lot of members are now public in the internal package that were private in the receiver which is likely what's causing GitHub to miss that they're just moved files.

This doesn't require a changelog (in my mind) because all things moving were originally private to the receiver. They're now still purely internal, so they won't be published.

I believe internal is the best destination for now as it allows us to solidify the usage and interface before moving it to pkg to be publicly available. There are still a lot of unknowns as far as how it can be used by other receivers, so I fully expect "breaking changes" to this. If we keep it internal we can update all usages with the changing interface, so the changes won't be breaking.

Link to tracking Issue:
#30297, #13546

Testing:
Existing tests are all passing.

Documentation:
This is purely an internal change.

@crobert-1 crobert-1 marked this pull request as ready for review January 22, 2024 23:10
@crobert-1 crobert-1 requested review from a team and MovieStoreGuy as code owners January 22, 2024 23:10
.github/CODEOWNERS Outdated Show resolved Hide resolved
cmd/configschema/go.mod Outdated Show resolved Hide resolved
@dmitryax
Copy link
Member

@crobert-1 can you please rebase and check CI failures?

@crobert-1
Copy link
Member Author

@crobert-1 can you please rebase and check CI failures?

Done. I've filed #30836 for the failing test, it was unrelated to these changes.

- Add myself as code owner to new package
- Remove unrelated godep updates
- Remove unnecessary Validate() call
@dmitryax dmitryax merged commit 070d931 into open-telemetry:main Feb 2, 2024
142 checks passed
@github-actions github-actions bot added this to the next release milestone Feb 2, 2024
Queries []Query `mapstructure:"queries"`
StorageID *component.ID `mapstructure:"storage"`
Telemetry TelemetryConfig `mapstructure:"telemetry"`
sqlquery.Config `mapstructure:",squash"`
}

func (c Config) Validate() error {
Copy link
Member

Choose a reason for hiding this comment

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

This function is redundant now. feel free to remove in a follow-up PR

dmitryax pushed a commit that referenced this pull request Feb 5, 2024
**Description:** 
[Requested change by
Dmitrii](#30709 (comment)),
this function was redundant as the underlying config has a `Validate`
function called automatically.
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
…pen-telemetry#30709)

**Description:** 
As noted in the related issues, a lot of the logic in the sqlquery
receiver can be moved to a central package to be used by other
receivers. I realize this appears to be a large change, but it's purely
a re-organization PR, there's no functional changes. GitHub is not
recognizing moved files, so please refer to new file names and their
deleted counterparts. A lot of members are now public in the internal
package that were private in the receiver which is likely what's causing
GitHub to miss that they're just moved files.

This doesn't require a changelog (in my mind) because all things moving
were originally private to the receiver. They're now still purely
internal, so they won't be published.

I believe `internal` is the best destination for now as it allows us to
solidify the usage and interface before moving it to `pkg` to be
publicly available. There are still a lot of unknowns as far as how it
can be used by other receivers, so I fully expect "breaking changes" to
this. If we keep it internal we can update all usages with the changing
interface, so the changes won't be breaking.

**Link to tracking Issue:** 
open-telemetry#30297, open-telemetry#13546
anthoai97 pushed a commit to anthoai97/opentelemetry-collector-contrib that referenced this pull request Feb 12, 2024
…elemetry#31042)

**Description:** 
[Requested change by
Dmitrii](open-telemetry#30709 (comment)),
this function was redundant as the underlying config has a `Validate`
function called automatically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants