-
Notifications
You must be signed in to change notification settings - Fork 207
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
Retrieve instance tags at the same time to reduce number of entities in Explore related experience #1474
Conversation
…in compass experience
@@ -257,9 +264,25 @@ func (s *serviceprovider) scrapeImdsServiceName() error { | |||
break | |||
} | |||
} | |||
if strings.Contains(tags, ec2tagger.Ec2InstanceTagKeyASG) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this strings.Contains if statement? We end up checking if the instance tag exists anyways in the next line. Seems excessive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only make a call if it exists in the list of tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, but in the end we would error out from s.metadataProvider.InstanceTagValue
if it doesn't exist right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but its a safety check to avoid additional calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since we are being consistent with existing code -- but worth revisiting removing the ASG char limit and checking for strings.Contains for the entire tags dump
Description of the issue
Describe the problem or feature in addition to a link to the issues.
Currently we have two separate threads for reading the AutoScalingGroup tag and the service name tags (service, application, or app). This causes different entities to be created as a result which can be confusing for the customer. We should have a single thread (and retryer) to retrieve all tags needed for entity population for the Explore related experience.
Description of changes
How does this change address the problem?
Implementation
We get the ASG + Service Name + all tags on init
Get all tags on an interval together until success
License
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Tests
Describe what tests you have done.
Unit Tests
Manual Tests
Before enabling the instance metadata tags
After enabling the instance metadata tags
Agents unlimited retried until successful retrieval of tags based of BackOffSleepArray. Stopped retying after first success
BackoffSleepArray = []time.Duration{0, 1 * time.Minute, 1 * time.Minute, 3 * time.Minute, 3 * time.Minute, 3 * time.Minute, 10 * time.Minute}
I enabled the instance tags at 19:53 and You can see above there is no retry after 19:57 until 20:21 current time.
Requirements
Before commit the code, please do the following steps.
make fmt
andmake fmt-sh
make lint