-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
⚡ opt unuse label #13034
⚡ opt unuse label #13034
Changes from 5 commits
af8d1f8
cba5ae1
cbdf38e
c2e4aa8
c503b3d
9e9f3f3
8f47eec
8efc540
de4deac
91fa256
e24b520
5db28a4
d87fa56
bfb7fef
9abc5ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,25 +59,30 @@ | |
public class MetricsSupport { | ||
|
||
private static final String version = Version.getVersion(); | ||
|
||
private static final String commitId = Version.getLastCommitId(); | ||
|
||
|
||
public static Map<String, String> applicationTags(ApplicationModel applicationModel) { | ||
return applicationTags(applicationModel, null); | ||
} | ||
|
||
public static Map<String, String> applicationTags(ApplicationModel applicationModel, @Nullable Map<String, String> extraInfo) { | ||
Map<String, String> tags = new HashMap<>(); | ||
tags.put(TAG_IP, getLocalHost()); | ||
tags.put(TAG_HOSTNAME, getLocalHostName()); | ||
tags.put(TAG_APPLICATION_NAME, applicationModel.getApplicationName()); | ||
tags.put(TAG_APPLICATION_MODULE, applicationModel.getInternalId()); | ||
tags.put(TAG_APPLICATION_VERSION_KEY, version); | ||
tags.put(MetricsKey.METADATA_GIT_COMMITID_METRIC.getName(), commitId); | ||
if (CollectionUtils.isNotEmptyMap(extraInfo)) { | ||
tags.putAll(extraInfo); | ||
} | ||
return tags; | ||
} | ||
public static Map<String, String> applicationPrivateTags(ApplicationModel applicationModel, Map<String, String> tags) { | ||
songxiaosheng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags.put(TAG_IP, getLocalHost()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 服务方法的指标数据,ip标签为何移走了?是怎么考量的? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ip可以直接查指标来源的 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 明白了,感谢!👍🏻 |
||
tags.put(TAG_HOSTNAME, getLocalHostName()); | ||
tags.put(MetricsKey.METADATA_GIT_COMMITID_METRIC.getName(), commitId); | ||
return tags; | ||
} | ||
|
||
public static Map<String, String> serviceTags(ApplicationModel applicationModel, String serviceKey, Map<String, String> extraInfo) { | ||
Map<String, String> tags = applicationTags(applicationModel, extraInfo); | ||
|
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.
Version
key can be moved intogitTags