Skip to content

Add FailureTracker for DiscoverPollEndpoint + ACS/TCS connect workflows - #4983

Merged
danehlim merged 1 commit into
aws:devfrom
danehlim:dpe-acs-tcs-connect-fail-track
Jun 1, 2026
Merged

danehlim merged 1 commit into
aws:devfrom
danehlim:dpe-acs-tcs-connect-fail-track

Conversation

@danehlim

@danehlim danehlim commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add to the ecs-agent module a new type FailureTracker, which is used to:

  • track whether an operation has been in a failure state continuously for longer than a specified time threshold (i.e., 1 minute), and
  • if so, emit a metric at a specified cadence (i.e., every 1 minute)

Use this new type to monitor failures in:

  • resolving ECS endpoints
  • establishing connection with ACS
  • establishing connection with TCS

Implementation details

  • Define FailureTracker and its functions
  • For each FailureTracker, record success upon each successful operation and record failure upon each terminal failure mode
  • Use functional options pattern to supply FailureTracker to structs which manage calling DiscoverPollEndpoint ECS API, connecting to ACS, and connecting to TCS (making supplying FailureTracker optional by design)

Out of scope

The following is out of scope of this pull request:

  • Updating ECS Agent (i.e., agent module) to supply FailureTracker when initializing its ACS session and TCS session and kick off metric emission logic
  • Adding support for other functional options to ACS session and TCS session besides newly added WithDPEFailureTracker, WithACSConnFailureTracker, and WithTCSConnFailureTracker
  • Removing any metrics already defined in ecs-agent/metrics/constants.go which may contain overlap with the newly added DPEConnectivityFailure, ACSConnectivityFailure, and TCSConnectivityFailure

Testing

New tests cover the changes: yes

Description for the changelog

N/A

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?

No

Does this PR include the addition of new environment variables in the README?

No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@danehlim
danehlim requested a review from a team as a code owner May 29, 2026 00:10
@danehlim
danehlim force-pushed the dpe-acs-tcs-connect-fail-track branch from 5b5f219 to 454ddd9 Compare May 29, 2026 00:23
Comment thread ecs-agent/metrics/failure_tracker.go Resolved
Comment thread ecs-agent/metrics/failure_tracker.go Resolved
Comment thread ecs-agent/metrics/failure_tracker.go Resolved
Comment thread ecs-agent/acs/session/session.go Resolved
@danehlim
danehlim force-pushed the dpe-acs-tcs-connect-fail-track branch from 454ddd9 to aa49367 Compare May 29, 2026 22:01
@danehlim
danehlim force-pushed the dpe-acs-tcs-connect-fail-track branch from aa49367 to 2d2d650 Compare May 29, 2026 23:11
@danehlim
danehlim merged commit 7cbeb76 into aws:dev Jun 1, 2026
45 checks passed
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.

4 participants