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

Support sending a service tag #269

Merged
merged 3 commits into from
Feb 17, 2020
Merged

Support sending a service tag #269

merged 3 commits into from
Feb 17, 2020

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Feb 14, 2020

We want to feature the notion of service more prominently for integrations so that we can correlate metrics with logs and traces

See:

DataDog/datadog-agent#4877
DataDog/datadog-agent#4895

Copy link
Contributor

@remeh remeh left a comment

Choose a reason for hiding this comment

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

Some small changes around the strings tests requested, but it looks good to me otherwise!

@@ -140,6 +141,14 @@ public Instance(
this.refreshBeansPeriod = appConfig.getRefreshBeansPeriod();
}

this.service = (String) instanceMap.get("service");
if ((this.service == null || this.service == "") && initConfig != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'll be better to do:

        if ((this.service == null || this.service.isEmpty()) && initConfig != null) {

You may already know but you should not use == with string in Java, if you don't want to go with .isEmpty you should use .equals

if ((this.service == null || this.service == "") && initConfig != null) {
this.service = (String) initConfig.get("service");
}
if (this.service != null && this.service != "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

this.service != null && !this.service.isEmpty()

@@ -667,6 +676,10 @@ private void refreshBeansList() throws IOException {
}
tags.add("instance:" + this.instanceName);

if (this.service != null && this.service != "") {
Copy link
Contributor

Choose a reason for hiding this comment

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

this.service != null && !this.service.isEmpty()

@remeh remeh merged commit 6c67ab1 into DataDog:master Feb 17, 2020
@ofek ofek deleted the service-tag branch February 17, 2020 16:47
@truthbk truthbk added this to the 0.35.0 milestone Feb 18, 2020
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