Skip to content

Commit

Permalink
Add example configuration files for test-api
Browse files Browse the repository at this point in the history
test-api is a minimal API server that the agent can connect to. The
implementation does not match the implementation of the actual API
server used in product, it's simply enough to allow the agent to connect
to it and receive checks and tenant information from it.

Signed-off-by: Marcelo E. Magallon <[email protected]>
  • Loading branch information
mem committed Nov 3, 2023
1 parent baeb314 commit 59de245
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/test-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test-api input files
====================

The files in this directory are the input to test-api.

* data.json is used to populate the database. The remote information must be
set to something valid, as it will be passed to the agent to publish metrics
and logs. Note the agent will need the token listed here.

* test-api.env contains the environment passed to the agent. The example file
contains the token (as listed in data.json) that the agent will use to
connect to test-api.
56 changes: 56 additions & 0 deletions examples/test-api/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"tenants": [
{
"id": 1,
"orgId": ..., // the org ID of the stack, can be made up
"stackId": ..., // the stack ID of the instances you are connecting to, can be made up
"metricsRemote": {
"name": "metrics",
"url": "https://.../api/prom", // URL of instance to push to, not just the base
"username": "...", // username to authenticate to prometheus instance
"password": "..." // password to authenticate to prometheus instance
},
"eventsRemote": {
"name": "logs",
"url": "https://.../loki/api/v1", // URL of instance to push to, not just the base
"username": "...", // username to authenticate to loki instance
"password": "..." // username to authenticate to loki instance
}
}
],
"probes": [
{
"id": 1,
"tenantId": 1,
"name": "test-probe"
}
],
"probeTokens": {
"1": "..." // random token, base-64 encoded
},
"checks": [
{
"id": 1,
"tenantId": 1,
"frequency": 60000,
"timeout": 10000,
"enabled": true,
"basicMetricsOnly": true,
"settings": {
"multihttp": {
"entries": [
{
"request": {
"method": "GET",
"url": "https://httpbin.test.k6.io/status/418"
}
}
]
}
},
"probes": [1],
"target": "test",
"job": "test"
}
]
}

0 comments on commit 59de245

Please sign in to comment.