-
Notifications
You must be signed in to change notification settings - Fork 366
Update metric tags on rename #3107
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
Update metric tags on rename #3107
Conversation
|
Without looking at this PR in much detail, it appears y'all implemented this differently than I would have. I would have expected the change to go through the Happy to chat more about this, if y'all want to. |
|
@Gerg Thanks. We chatted about this with @sethboyles and @dalvarado and agreed to modify the action rather than changing process observer. @sethboyles liked having the logic in the action and it wasn't clear how to access the app name change from process observer. |
|
@sethboyles @dalvarado Thanks for the feedback yesterday. We pushed an additional commit d953945 to move the Desired LRP Update outside of the database transaction. |
|
@sethboyles @dalvarado We pushed another commit 1afdda2 to not refer to a new revision of the desired lrp update endpoint. We agreed with @winkingturtle-vmw that introducing a new revision wasn't necessary. |
1afdda2 to
b5365dc
Compare
|
@sethboyles We saw that the changes in this PR currently aren't sufficient to ensure that the metric tags are updated when the initial call from CAPI to the BBS fails. The processes sync job uses the process updated_at timestamp to determine whether it needs to update the diego process, and this hasn't changed when an app is renamed.
Do y'all have a preferred option? |
|
If you do end up changing the sync logic, I'll draw your attention to https://github.com/cloudfoundry/sync-integration-tests. |
Though thinking about it that might require saying where annotation < app updated_at which means we'd be going from treating the annotation as an opaque field to requiring it to be an epoch time. I don't think I like that. |
|
We pushed a commit that updates the process timestamps when renaming an app to ensure that convergence takes place. We're not entirely happy with the sleep added to the tests. We had trouble getting Timecop to play nicely with the Sequel current_datetime_timestamp extension, if you have an alternative approach to implementing this that would be great too. |
|
I think TimeCop is not working because the Sequel plugin uses database-native time functions. You probably need to spy/mock things at a higher level (before it issues the DB query). |
|
We pushed another commit with a different testing approach using doubles instead. We get to remove the sleep but the test is possibly not quite as good. |
cloudfoundry/diego-release#662 Co-authored-by: Rebecca Roberts <robertsre@vmware.com>
Bumping the endpoint revision was determined not to be necessary, see this PR for more context: cloudfoundry/bbs#51 cloudfoundry/diego-release#662
- The process timestamp is compared against the Diego LRP annotation for convergence - Save the processes associated with the app so that the timestamp is updated and convergence will take place - The tests added in this commit use sleep (which we're not happy about) but we had difficulty setting an old timestamp due to the Sequel current_datetime_timestamp extension Signed-off-by: Rebecca Roberts <robertsre@vmware.com>
- Use doubles instead of real models to avoid sleeping in the tests Co-authored-by: Andrew Crump <crumpan@vmware.com>
a8a31cf to
aba8ec2
Compare
|
It sounds like the strategy from earlier guidance has led y'all down a fine path. LGTM, for now |
|
Please feel free to squash merge this PR if y'all want to keep your history more clean. That would get rid of some of the back and forth commits that undo each other lol. |
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
Modifies the cloud controller to send a DesiredLRPUpdate with updated metric tags to Diego when an application is renamed.
The diego client will be using the new/v1/desired_lrp/update.r1BBS endpoint.We noticed that the CAPI pipeline uses protoc v3.6.1 which is quite an old version. We used that version to regenerate the protobuf client code in this PR but it may be worth considering upgrading. We also wondered if the associated concourse task script should include
set -e.Pending changes to Diego, this should allow renames to take effect without requiring an application restart.
cloudfoundry/diego-release#662
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests