Comment on page
🧩
API
The agent's setup is adjustable using direct API invocations, facilitating interactive information retrieval and interaction.
Agent API can be reached at https://<<host_name>>:<<port_number>>
host_name: Refers to the host where the agent is installed (or localhost if used locally).
port_number: By default, the agent listens on port 8282, which can be updated as needed
Examples are demonstrated using localhost as the host name and the default port number 8282.
Certain operations necessitate a header token for transmission to the agent. This token aligns with the agent's license key and the platform it operates on.
// example
export TOKEN=<<datasentinel_token>>
curl -k --header "api-token: $TOKEN" --request PUT https://localhost:8282/api/agent/stop'
get
https://localhost:8282
/api/agent/status
Status
put
https://localhost:8282
/api/agent/stop
Stop
patch
https://localhost:8282
/api/agent/port/{port}
Port Number
patch
https://localhost:8282
/api/agent/tables-monitoring-limit/{limit}
Table Monitoring Limit
patch
https://localhost:8282
/api/agent/query-monitoring-limit/{limit}
Query Monitoring Limit
The Upload Server refers to the server name of the platform where metrics are transmitted.
put
https://localhost:8282
/api/server
Set attributes
// Example
cat > body.json << EOF
{
"host": "demo.datasentinel.io",
"port": 443
}
EOF
export TOKEN=<<datasentinel_token>>
curl -k --header "api-token: $TOKEN" --header 'Content-Type: application/json' -X PUT https://localhost:8282/api/server -d @body.json
get
https://localhost:8282
/api/server
Show attributes
post
https://localhost:8282
/api/server/test-upload
Test Upload
Under certain circumstances, an intermediary proxy server is required to establish a connection between the agent and the platform server.
post
https://localhost:8282
/api/proxy
Set attributes
// Example
cat > body.json << EOF
{
"host": "proxy-server",
"port": 12443,
"user": "",
"password": ""
}
EOF
export TOKEN=<<datasentinel_token>>
curl -k --header "api-token: $TOKEN" --header 'Content-Type: application/json' -X POST https://localhost:8282/api/proxy -d @body.json
get
https://localhost:8282
/api/proxy
Show attributes
delete
https://localhost:8282
/api/proxy
get
https://localhost:8282
/api/connections
Show Connections
patch
https://localhost:8282
/api/connections/enable
Enable All
patch
https://localhost:8282
/api/connections/disable
Disable All
post
https://localhost:8282
/api/connections/{connection_name}
Add Connection
// Example
cat > body.json << EOF
{
"host": "pg-sales-3127",
"port": 9342,
"user": "datasentinel",
"password": "sentinel",
"tags": "application=sales,environment=production,provider=amazon,datacenter=paris"
}
EOF
export TOKEN=<<datasentinel_token>>
curl -k --header "api-token: $TOKEN" --header 'Content-Type: application/json' --request POST 'https://localhost:8282/api/connections/sales_prod' -d @body.json
get
https://localhost:8282
/api/connections/{connection_name}
Show Connection
put
https://localhost:8282
/api/connections/{connection_name}
Update Connection
delete
https://localhost:8282
/api/connections/{connection_name}
patch
https://localhost:8282
/api/connections/{connection_name}/enable
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable
Disable
The Agent version 3.2, which was released in February 2023, introduces the Collection Level feature allowing you to choose the metrics to monitor.
Collection Level settings are displayed within the connection properties.
patch
https://localhost:8282
/api/connections/{connection_name}/enable-samples
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable-samples
Disable
patch
https://localhost:8282
/api/connections/{connection_name}/enable-lock-monitoring
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable-lock-monitoring
Disable
patch
https://localhost:8282
/api/connections/{connection_name}/lock-monitoring-delay/{seconds}
Delay
patch
https://localhost:8282
/api/connections/{connection_name}/enable-table-monitoring
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable-table-monitoring
Disable
patch
https://localhost:8282
/api/connections/{connection_name}/enable-query-monitoring
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable-query-monitoring
Disable
patch
https://localhost:8282
/api/connections/{connection_name}/query-monitoring-min-calls/{min-calls}
Min Calls
patch
https://localhost:8282
/api/connections/{connection_name}/query-monitoring-min-time/{seconds}
Min Time
patch
https://localhost:8282
/api/connections/{connection_name}/enable-query-monitoring-optimize
Enable
patch
https://localhost:8282
/api/connections/{connection_name}/disable-query-monitoring-optimize
Disable
Last modified 2mo ago