Skip to content

Commit

Permalink
Merge pull request #413 from snetsystems/dev-1.4.0-hajaegeun
Browse files Browse the repository at this point in the history
Added the default option for collecting into the telegraf config for OSP
  • Loading branch information
snetsystems authored Jun 29, 2023
2 parents a0aaa63 + f5f743e commit 1fdef1b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
52 changes: 40 additions & 12 deletions backend/canned/openstack.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"name": "CPU Usage",
"queries": [
{
"query": "SELECT non_negative_derivative(mean(\"cpu0_time\")) AS \"mean_cpu0_time\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\"",
"label": "",
"query": "SELECT non_negative_derivative(mean(\"cpu_time\"), 1s) / 10000000 AS \"cpu_percent\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\"",
"label": "CPU Usage",
"groupbys": [],
"wheres": []
}
Expand All @@ -32,7 +32,7 @@
},
"y": {
"bounds": ["", ""],
"label": "",
"label": "CPU Usage",
"prefix": "",
"suffix": "",
"base": "10",
Expand All @@ -57,10 +57,10 @@
"h": 30,
"minW": 10,
"minH": 4,
"name": "Port Recevie Packet",
"name": "Port Recevie",
"queries": [
{
"query": "SELECT mean(\"port_rx_packets\") AS \"mean_port_rx_packets\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\"",
"query": "SELECT non_negative_derivative(mean(\"port_rx\")) AS \"port_rx\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\"",
"label": "",
"groupbys": [],
"wheres": []
Expand All @@ -77,7 +77,7 @@
},
"y": {
"bounds": ["", ""],
"label": "port_rx_packets",
"label": "Port Recevie",
"prefix": "",
"suffix": "",
"base": "10",
Expand All @@ -102,12 +102,22 @@
"h": 12,
"minW": 10,
"minH": 4,
"name": "Port Transmit Packets",
"name": "Port Transmit",
"queries": [
{
"query": "SELECT non_negative_derivative(max(\"port_tx_packets\")) AS \"mean_port_tx_packets\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\""
"query": "SELECT non_negative_derivative(mean(\"port_tx\")) AS \"mean_port_tx\" FROM \":db:\".\":rp:\".\"openstack_server_diagnostics\""
}
]
],
"axes": {
"y": {
"bounds": ["", ""],
"label": "Port Transmit",
"prefix": "",
"suffix": "",
"base": "10",
"scale": "linear"
}
}
},

{
Expand Down Expand Up @@ -163,7 +173,7 @@
},
"y": {
"bounds": ["", ""],
"label": "",
"label": "Memory Used",
"prefix": "",
"suffix": "",
"base": "2",
Expand Down Expand Up @@ -215,7 +225,16 @@
"wheres": []
}
],

"axes": {
"y": {
"bounds": ["", ""],
"label": "Disk Read Request",
"prefix": "",
"suffix": "",
"base": "2",
"scale": "linear"
}
},
"type": "line"
},
{
Expand All @@ -235,7 +254,16 @@
"wheres": []
}
],

"axes": {
"y": {
"bounds": ["", ""],
"label": "Disk Write Request",
"prefix": "",
"suffix": "",
"base": "2",
"scale": "linear"
}
},
"type": "line"
}
]
Expand Down
2 changes: 1 addition & 1 deletion backend/server/csp.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ func (s *Service) generateTelegrafConfigForOSP(ctx context.Context, csp *cloudhu
{
Interval: "2m",
AuthenticationEndpoint: s.OSP.AuthURL,
EnabledServices: []string{"servers", "flavors"},
EnabledServices: []string{"projects", "servers", "flavors", "networks", "ports", "storage_pools", "subnets", "volumes", "compute_quotas", "network_quotas", "volume_quotas"},
Domain: s.OSP.UserDomain,
Project: csp.NameSpace,
Username: s.OSP.AdminUser,
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/agent_admin/constants/CollectorConfigTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ export const COLLECTOR_DROPDOWN_DATA = [
'projects',
'servers',
'services',
'stacks',
'storage_pools',
'subnets',
'volumes',
'compute_quotas',
'network_quotas',
'volume_quotas',
]

export const COLLECTOR_CONFIG_TAB_ABBREVIATION = {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/agent_admin/containers/ServiceConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,10 @@ export class ServiceConfig extends PureComponent<Props, State> {

getRunLocalServiceDebugTelegraf
.then(({data}): void => {
const isTestFailed = data.indexOf('E!') !== -1 ? true : false
const isTestFailed =
data.includes('E!') || data.includes('runtime error')
? true
: false

if (isTestFailed) {
const errorMessage = data.split('[telegraf]')[1]
Expand Down

0 comments on commit 1fdef1b

Please sign in to comment.