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

ECS Fargate/Dogstatsd task_arn tag on with orchestrator cardinality #5324

Merged
merged 9 commits into from
Apr 17, 2020

Conversation

xornivore
Copy link
Contributor

What does this PR do?

Enrich dogstatsd metrics with task_arn tag if DD_DOGSTATSD_TAG_CARDINALITY=orchestrator.

Motivation

Automatically inject task_arn tag to all the dogstatsd metric.

Additional Notes

#3159

pkg/dogstatsd/server.go Outdated Show resolved Hide resolved
xornivore and others added 3 commits April 10, 2020 18:32
Co-Authored-By: Ahmed Mezghani <38987709+ahmed-mez@users.noreply.github.com>
@xornivore xornivore marked this pull request as ready for review April 13, 2020 16:44
@xornivore xornivore requested review from a team as code owners April 13, 2020 16:44
@xornivore xornivore changed the title WIP: ECS Fargate/Dogstatsd task_arn tag on with orchestrator cardinality ECS Fargate/Dogstatsd task_arn tag on with orchestrator cardinality Apr 14, 2020
clamoriniere
clamoriniere previously approved these changes Apr 16, 2020
ahmed-mez
ahmed-mez previously approved these changes Apr 16, 2020
Copy link
Contributor

@ahmed-mez ahmed-mez left a comment

Choose a reason for hiding this comment

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

:shipit:

@xornivore xornivore dismissed stale reviews from ahmed-mez and clamoriniere via ccaea98 April 16, 2020 22:52
lastExpire time.Time
expireFreq time.Duration
labelsAsTags map[string]string
doOnceOrchScope sync.Once
Copy link
Contributor

Choose a reason for hiding this comment

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

nit, why don't we embed the struct?

Suggested change
doOnceOrchScope sync.Once
sync.Once

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel pretty strongly that we should encourage using the same sync.Once for anything else other than this orchestrator scope, if that changes we may want to revisit, But also consider that If we embed it, Do becomes an exported method for ECSFargateCollector while it's actually more of an implementation detail that we use sync.Once.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth a comment for the scope of this once.

ahmed-mez
ahmed-mez previously approved these changes Apr 17, 2020
remeh
remeh previously approved these changes Apr 17, 2020
@@ -501,6 +502,16 @@ func findOriginTags(origin string) []string {
tags = append(tags, originTags...)
}
}

// Include orchestrator scope tags if the cardinality is set to orchestrator
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: should we really do that in findOriginTags? We're not testing for listeners.NoOrigin and it not seems that much related (I may be wrong on the second part). Feel free to ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So findOriginTags carries the notion of get tags for the case of "no entity id provided". Not sure if @ahmed-mez or @clamoriniere have an opinion on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes technically we're not adding origin tags here 🤔

lastExpire time.Time
expireFreq time.Duration
labelsAsTags map[string]string
doOnceOrchScope sync.Once
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably worth a comment for the scope of this once.

@xornivore xornivore dismissed stale reviews from remeh and ahmed-mez via ba2724e April 17, 2020 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants