Skip to content

Commit

Permalink
feat(logconfig/enablerequestmetrics): service logconfig add enablereq…
Browse files Browse the repository at this point in the history
…uestmetrics
  • Loading branch information
wss-git committed Jan 28, 2021
1 parent 5eb7ff0 commit 448d105
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion docs/specs/2018-04-03-zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,15 @@ VpcConfig:
Log 配置对象用来指定函数执行的日志将要存储到的日志服务。
Log 配置对象可配置的属性包括:`Project`、`Logstore`。其中 `Project`、`Logstore` 的概念与日志服务中的概念一致。更多信息[参考](https://help.aliyun.com/document_detail/73349.html?spm=5176.11065259.1996646101.searchclickresult.3ee82ea1o9HX6S#console-log-config)。
Log 配置对象可配置的属性包括:`Project`、`Logstore`、`EnableRequestMetrics`。其中 `Project`、`Logstore` 的概念与日志服务中的概念一致。更多信息[参考](https://help.aliyun.com/document_detail/73349.html?spm=5176.11065259.1996646101.searchclickresult.3ee82ea1o9HX6S#console-log-config)。
示例:
```
LogConfig:
Project: localtestlog
Logstore: localteststore
EnableRequestMetrics: true/false
```
#### Nas 配置对象
Expand Down
6 changes: 4 additions & 2 deletions src/lib/fc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,8 @@ async function generateDefaultLogConfig() {
const profile = await getProfile();
return {
project: generateSlsProjectName(profile.accountId, profile.defaultRegion),
logstore: `function-log`
logstore: `function-log`,
enableRequestMetrics: true
};
}

Expand All @@ -1328,7 +1329,8 @@ async function transformLogConfig(logConfig) {

return {
project: logConfig.Project || '',
logstore: logConfig.Logstore || ''
logstore: logConfig.Logstore || '',
enableRequestMetrics: logConfig.EnableRequestMetrics || false
};
}

Expand Down
3 changes: 2 additions & 1 deletion src/lib/language-service/schema/rosSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export const rosSchema = {
"type": "object",
"properties": {
"Project": { "type": "string" },
"Logstore": { "type": "string" }
"Logstore": { "type": "string" },
"EnableRequestMetrics": { "type": "boolean" }
},
"required": ["Project", "Logstore"],
"additionalProperties": false
Expand Down
3 changes: 2 additions & 1 deletion src/lib/validate/schema/service-resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const serviceResourceSchema = {
'type': 'object',
'properties': {
'Project': { 'type': 'string' },
'Logstore': { 'type': 'string' }
'Logstore': { 'type': 'string' },
'EnableRequestMetrics': { 'type': 'boolean' }
},
'required': ['Project', 'Logstore'],
'additionalProperties': false
Expand Down

0 comments on commit 448d105

Please sign in to comment.