-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support integration with prometheus(#11)
* feat: 整合prometheus * feat: 整合prometheus * feat: 脚手架整合prometheus * feat: prod环境添加未选择prometheus时的默认配置 * chore: 处理pr comment * chore: 处理pr comment(2) * docs: optimize docs * docs: optimize docs Co-authored-by: taccisum <514162920@qq.com>
- Loading branch information
Showing
9 changed files
with
79 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
generators/app/handler/configurer/prometheus_configurer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const _ = require('lodash'); | ||
|
||
module.exports = { | ||
key: 'prometheus', | ||
fn: { | ||
configureProviderPomDependencies (optionalDependencies) { | ||
optionalDependencies.push({ | ||
dependency: [ | ||
{ groupId: 'io.micrometer' }, | ||
{ artifactId: 'micrometer-core' } | ||
] | ||
}); | ||
optionalDependencies.push({ | ||
dependency: [ | ||
{ groupId: 'io.micrometer' }, | ||
{ artifactId: 'micrometer-registry-prometheus' } | ||
] | ||
}) | ||
}, | ||
configureApplicationYaml (yaml, env) { | ||
switch (env) { | ||
case 'prod': { | ||
_.merge(yaml, { | ||
management: { | ||
endpoints: { | ||
web: { | ||
exposure: { | ||
include: 'health, info, prometheus' | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
break; | ||
} | ||
|
||
default: { | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
management: | ||
endpoints: | ||
web: | ||
exposure: | ||
include: '*' | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ management: | |
endpoints: | ||
web: | ||
exposure: | ||
include: health, info | ||
include: 'health, info' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,4 +187,4 @@ | |
</activation> | ||
</profile> | ||
</profiles> | ||
</project> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters