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

PMM-13166: Ability to monitor DBs from a different node #766

Merged
merged 35 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a3ef553
Nodes for MySQLConnection
doracretu3pillar Jul 24, 2024
a0353ac
Added Nodes Agents component
doracretu3pillar Jul 29, 2024
c39224b
Added pmm_agent_id parameter instead of agent/node
doracretu3pillar Jul 29, 2024
98f238a
Added NodesAgents to all the services
doracretu3pillar Aug 5, 2024
218ccdd
Fixes after reviews
doracretu3pillar Aug 16, 2024
2db183c
Testing NodesAgents in progress
doracretu3pillar Aug 21, 2024
c549be1
Added NodesAgents test
doracretu3pillar Aug 22, 2024
af05984
Fix from PR
doracretu3pillar Aug 29, 2024
cd89d7b
Fixes after PR
doracretu3pillar Sep 6, 2024
cc639cd
Prettier fix
DoraCretu594118 Sep 10, 2024
dfb3498
Merge branch 'v3' into PMM-13166_nodes_monitor_db
doracretu3pillar Sep 10, 2024
395a1a7
Fixed ts issues
DoraCretu594118 Sep 10, 2024
f2a327f
Merge branch 'PMM-13166_nodes_monitor_db' of https://github.com/perco…
DoraCretu594118 Sep 10, 2024
088e376
Added the types to mappedNodes, nodesOptions, changed the agent name …
doracretu3pillar Sep 19, 2024
17f0547
Updated tests - partial
doracretu3pillar Sep 19, 2024
ade9992
Merge branch 'v3' into PMM-13166_nodes_monitor_db
doracretu3pillar Sep 20, 2024
fee3eed
Partially tests
doracretu3pillar Sep 20, 2024
44c2d5d
Fixed tests
doracretu3pillar Sep 20, 2024
d64b7e8
Added node_type to node mocks and fixed eslint for NodesAgents
doracretu3pillar Sep 20, 2024
d8318ae
Fixed other tests related to Add Service
doracretu3pillar Sep 20, 2024
b95747b
More tests fixed
doracretu3pillar Sep 20, 2024
78507cb
Fixed prettier
doracretu3pillar Sep 20, 2024
ced9f39
Added spy on console.error
doracretu3pillar Sep 21, 2024
c478147
Added test for console error
doracretu3pillar Sep 21, 2024
40fbcbb
Added console error check to every test
doracretu3pillar Sep 21, 2024
864dfe4
Fixes after PR
doracretu3pillar Sep 23, 2024
68548b7
Replaced the formAPI with taken values from the form, and added new m…
doracretu3pillar Sep 23, 2024
59e041f
SelectedAgent can be undefined
doracretu3pillar Sep 23, 2024
09b6adb
Clear mock before each test
doracretu3pillar Sep 23, 2024
6c07180
Added wait for to last test
doracretu3pillar Sep 23, 2024
24f3a77
If address is localhost then send node_id instead of add_node, and se…
doracretu3pillar Sep 30, 2024
2618cbf
Fixes after PR
doracretu3pillar Sep 30, 2024
09097c3
Fixed prettier
doracretu3pillar Sep 30, 2024
4bd8d20
Merge branch 'v3' into PMM-13166_nodes_monitor_db
doracretu3pillar Sep 30, 2024
4476cbc
Merge branch 'v3' into PMM-13166_nodes_monitor_db
doracretu3pillar Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ describe('AddRemoteInstanceService:: ', () => {
pmm_agent_id: {
value: 'pmm-server',
},
node: {
value: 'node1',
label: 'node1',
},
};

const payload = {
Expand All @@ -94,7 +98,8 @@ describe('AddRemoteInstanceService:: ', () => {
pmm_agent_id: 'pmm-server',
port: '80',
qan_postgresql_pgstatements_agent: true,
metrics_mode: 1,
metrics_mode: 2,
node_id: 'node1',
};
expect(toPayload(data)).toStrictEqual(payload);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CancelToken } from 'axios';

import { PMM_SERVER_NODE_AGENT_ID } from 'app/percona/add-instance/components/AddRemoteInstance/FormParts/NodesAgents/NodesAgents.constants';
import { Databases } from 'app/percona/shared/core';
import { apiManagement } from 'app/percona/shared/helpers/api';

Expand Down Expand Up @@ -142,13 +143,20 @@ export const toPayload = (values: any, discoverName?: string, type?: InstanceAva
data.service_name = data.address;
}

if (!values.isAzure && data.add_node === undefined) {
if (
(!values.isAzure && data.add_node === undefined) ||
(data.address !== '127.0.0.1' && data.address !== 'localhost')
) {
data.add_node = {
node_name: data.service_name,
node_type: 'NODE_TYPE_REMOTE_NODE',
};
}

if (data.address === '127.0.0.1' || data.address === 'localhost') {
data.node_id = data.node.value;
}
doracretu3pillar marked this conversation as resolved.
Show resolved Hide resolved

if (values.isRDS && discoverName) {
data.engine = discoverName;
}
Expand Down Expand Up @@ -181,7 +189,11 @@ export const toPayload = (values: any, discoverName?: string, type?: InstanceAva

data.pmm_agent_id = values.pmm_agent_id.value;

data.metrics_mode = 1;
if (data.pmm_agent_id === PMM_SERVER_NODE_AGENT_ID) {
data.metrics_mode = 2;
} else {
data.metrics_mode = 1;
}
doracretu3pillar marked this conversation as resolved.
Show resolved Hide resolved
doracretu3pillar marked this conversation as resolved.
Show resolved Hide resolved
delete data.tracking;
delete data.node;

Expand Down
Loading