Skip to content

Commit

Permalink
Emit failure and total metrics for DPE call (#4488)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxx0624 authored Feb 5, 2025
1 parent 0f64bd3 commit 388aadd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ecs-agent/api/ecs/client/ecs_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,8 @@ func (client *ecsClient) discoverPollEndpoint(containerInstanceArn string,
Cluster: aws.String(client.configAccessor.Cluster()),
ZoneId: aws.String(availabilityZone),
})
client.metricsFactory.New(metrics.DiscoverPollEndpointCallName).Done(err)
client.metricsFactory.New(metrics.DiscoverPollEndpointFailure).Done(err)
client.metricsFactory.New(metrics.DiscoverPollEndpointTotal).Done(nil)
if err != nil {
// If we got an error calling the API, fallback to an expired cached endpoint if
// we have it.
Expand Down
3 changes: 2 additions & 1 deletion ecs-agent/metrics/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const (

// ECS Client Metrics
ecsClientNamespace = "ECSClient"
DiscoverPollEndpointCallName = ecsClientNamespace + ".DiscoverPollEndpoint"
DiscoverPollEndpointFailure = ecsClientNamespace + ".DiscoverPollEndpointFailure"
DiscoverPollEndpointTotal = ecsClientNamespace + ".DiscoverPollEndpoint"
DiscoverPollEndpointDurationName = ecsClientNamespace + ".DiscoverPollEndpointDuration"

dbClientMetricNamespace = "Data"
Expand Down

0 comments on commit 388aadd

Please sign in to comment.