openark / orchestrator

MySQL replication topology management and HA
Apache License 2.0
5.64k stars 933 forks source link

api-problems does not provide reason as in GUI #756

Closed utdrmac closed 5 years ago

utdrmac commented 5 years ago

The "problem" messages which are visible in the GUI are not visible when using the /api/problems endpoint. Please add this string to the output of the API. If the API returns a host, that JSON object should contain a key 'Reason:' with the same message as in the GUI.

Here is what the GUI shows: screen shot 2018-12-12 at 8 21 26 pm

Here is what the API shows:

[vagrant@mysql1 ~]$ curl -s http://orchestrator:3000/api/problems | jq '.[1] '
{
  "Key": {
    "Hostname": "mysql3.dc2",
    "Port": 3306
  },
  "InstanceAlias": "",
  "Uptime": 101042,
  "ServerID": 43,
  "ServerUUID": "ca97e7be-f829-11e8-9df4-525400c9c704",
  "Version": "5.7.24-26-log",
  "VersionComment": "Percona Server (GPL), Release 26, Revision c8fe767",
  "FlavorName": "Percona",
  "ReadOnly": true,
  "Binlog_format": "ROW",
  "BinlogRowImage": "FULL",
  "LogBinEnabled": true,
  "LogSlaveUpdatesEnabled": false,
  "SelfBinlogCoordinates": {
    "LogFile": "mysql-bin.000004",
    "LogPos": 769,
    "Type": 0
  },
  "MasterKey": {
    "Hostname": "mysql1.dc1",
    "Port": 3306
  },
  "MasterUUID": "181a1121-f827-11e8-87a5-525400c9c704",
  "AncestryUUID": "181a1121-f827-11e8-87a5-525400c9c704,ca97e7be-f829-11e8-9df4-525400c9c704",
  "IsDetachedMaster": false,
  "Slave_SQL_Running": true,
  "Slave_IO_Running": true,
  "HasReplicationFilters": false,
  "GTIDMode": "OFF",
  "SupportsOracleGTID": false,
  "UsingOracleGTID": false,
  "UsingMariaDBGTID": false,
  "UsingPseudoGTID": true,
  "ReadBinlogCoordinates": {
    "LogFile": "mysql-bin.000008",
    "LogPos": 35558248,
    "Type": 0
  },
  "ExecBinlogCoordinates": {
    "LogFile": "mysql-bin.000008",
    "LogPos": 33255670,
    "Type": 0
  },
  "IsDetached": false,
  "RelaylogCoordinates": {
    "LogFile": "mysql3-relay-bin.000017",
    "LogPos": 6941482,
    "Type": 1
  },
  "LastSQLError": "",
  "LastIOError": "",
  "SecondsBehindMaster": {
    "Int64": 227,
    "Valid": true
  },
  "SQLDelay": 0,
  "ExecutedGtidSet": "",
  "GtidPurged": "",
  "GtidErrant": "",
  "SlaveLagSeconds": {
    "Int64": 227,
    "Valid": true
  },
  "SlaveHosts": [],
  "ClusterName": "mysql1.dc1:3306",
  "SuggestedClusterAlias": "enterprise",
  "DataCenter": "dc2",
  "PhysicalEnvironment": "",
  "ReplicationDepth": 1,
  "IsCoMaster": false,
  "HasReplicationCredentials": true,
  "ReplicationCredentialsAvailable": true,
  "SemiSyncEnforced": false,
  "SemiSyncMasterEnabled": false,
  "SemiSyncReplicaEnabled": false,
  "LastSeenTimestamp": "2018-12-13T02:20:45Z",
  "IsLastCheckValid": true,
  "IsUpToDate": false,
  "IsRecentlyChecked": true,
  "SecondsSinceLastSeen": {
    "Int64": 6,
    "Valid": true
  },
  "CountMySQLSnapshots": 0,
  "IsCandidate": false,
  "PromotionRule": "neutral",
  "IsDowntimed": false,
  "DowntimeReason": "",
  "DowntimeOwner": "",
  "DowntimeEndTimestamp": "",
  "ElapsedDowntime": 0,
  "UnresolvedHostname": "",
  "AllowTLS": false,
  "LastDiscoveryLatency": 3285915393
}
shlomi-noach commented 5 years ago

Agreed. This should come from the API, not from the web interface.