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

Migrate to SDK v3 #160

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Migrate to SDK v3 #160

merged 2 commits into from
Oct 5, 2021

Conversation

roobre
Copy link
Contributor

@roobre roobre commented Jul 16, 2021

This PR updates the integration SDK to version 3.

Closes #145

@roobre
Copy link
Contributor Author

roobre commented Jul 16, 2021

Linting errors related to goimports will be tackled later since they encompass even more files than those that this PR touches already

@roobre
Copy link
Contributor Author

roobre commented Jul 16, 2021

Rebased main, which includes #148

@roobre
Copy link
Contributor Author

roobre commented Jul 16, 2021

Tests are failing due to missing entityName entry in MetricSets, wether this is required or not is being investigated with @newrelic/caos.

@@ -171,7 +170,7 @@ func (d *MultiDiscoveryCacher) discoverAndCache(timeout time.Duration) ([]HTTPCl
err = d.Storage.Write(d.StorageKey, toCache)
}
if err != nil {
d.Logger.WithError(err).Warnf("while storing %q in the cache", d.StorageKey)
d.Logger.Warnf("Could not store %q in the cache: %v", d.StorageKey, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should log the raw data here, which would help debugging cache issues. Also, it would be nice to have unique error messages. Perhaps Decompose + Write part could be refactored into a function?

src/client/cached.go Outdated Show resolved Hide resolved
src/controlplane/client/discovery.go Outdated Show resolved Hide resolved
src/definition/populate.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Show resolved Hide resolved
@invidian
Copy link
Contributor

I fixed the imports here. Some details could be addressed here, but overall the PR looks good 👍

src/kubernetes.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/prometheus/http_test.go Outdated Show resolved Hide resolved
@roobre roobre force-pushed the sdk-v3 branch 2 times, most recently from e37f717 to cd32a8a Compare July 20, 2021 12:05
e2e/jsonschema/match.go Outdated Show resolved Hide resolved
e2e/jsonschema/match.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/metric/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
src/definition/populate_test.go Outdated Show resolved Hide resolved
@roobre roobre force-pushed the sdk-v3 branch 2 times, most recently from d1c6187 to 7f589cc Compare July 20, 2021 13:07
Copy link
Contributor

@invidian invidian left a comment

Choose a reason for hiding this comment

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

LGTM

@roobre
Copy link
Contributor Author

roobre commented Jul 21, 2021

Holding merge until we perform end to end tests.

Copy link
Contributor

@gsanchezgavier gsanchezgavier left a comment

Choose a reason for hiding this comment

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

LGTM , is wired that the version of the sdk we were using was kind of "almost" v3 from what i could read in the docs for the sdk , but still the protocol version on the json output was 2 and i saw you change it to 3, this is the most scary part to me, and how entities behave.

@roobre
Copy link
Contributor Author

roobre commented Jul 21, 2021

@gsanchezgavier There is a small change on how the entityName is generated. Previously, the SDK did it, and now that generation falls on the agent side. However I checked and they are using the same strategy, so I don't expect breakage there.

Before release, we can upgrade the canaries cluster to this version and ensure that pods and containers keep the same entity IDs and names.

@roobre roobre force-pushed the sdk-v3 branch 3 times, most recently from e5dbded to 44be8ad Compare July 28, 2021 08:43
Copy link
Contributor

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Just some small nits, overall LGTM. Nice work @roobre!

cmd/kubernetes-discovery/main.go Outdated Show resolved Hide resolved
src/ksm/client/discovery.go Outdated Show resolved Hide resolved
@paologallinaharbur
Copy link
Member

@roobre is this blocked by any task? there is the risk of forgetting about it

@invidian
Copy link
Contributor

invidian commented Oct 5, 2021

I suggest we merge #227 first.

@invidian
Copy link
Contributor

invidian commented Oct 5, 2021

Squashed commits and rebased on latest main. It's ready to review 🎉

e2e/jsonschema/match.go Outdated Show resolved Hide resolved
src/definition/populate.go Outdated Show resolved Hide resolved
@invidian invidian force-pushed the sdk-v3 branch 2 times, most recently from 043561a to 44d6c4e Compare October 5, 2021 12:51
@roobre
Copy link
Contributor Author

roobre commented Oct 5, 2021

roobre approved these changes on 5 Oct

invidian and others added 2 commits October 5, 2021 15:21
Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Co-authored-by: Roberto Santalla <roobre@roobre.es>
New SDK version does not need it anymore.

Signed-off-by: Mateusz Gozdek <mgozdek@microsoft.com>
Copy link
Contributor

@invidian invidian left a comment

Choose a reason for hiding this comment

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

LGTM. Had to merge logger changes with the first PR, as otherwise code did not compile.

@roobre roobre merged commit 5044159 into main Oct 5, 2021
@roobre roobre deleted the sdk-v3 branch October 5, 2021 15:50
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.

Update to SDK v3 or v4
4 participants