Skip to content

API Prometheus Jobs and Targets Observability

You need your project ID and Observability instance ID to interact with the Observability API.
Example URL: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/scrapeconfigs
Please consult the official API documentation for in depth information on the expected request.

With the following HTTP message body you have the minimal configuration of a new job and target:

{
"staticConfigs": [
{
"targets": [
"your-url-which-delivers-your-metrics.com:9100"
]
}
],
"jobName": "Job-1",
"scheme": "http",
"scrapeInterval": "5m",
"scrapeTimeout": "2m",
"metricsPath": "/metrics"
}

Send this request as HTTP POST method to configure your first job and target.

Instead of HTTP POST method, in this case we need HTTP PATCH to patch our existing job and target.
Example URL: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/scrapeconfigs.

Please consult the official API documentation for in depth information on the expected request.

With following body, you have the minimum configuration for a modified job and target:

{
"staticConfigs": [
{
"targets": [
"your-changed-url-which-delivers-your-metrics.com:9100"
]
}
],
"jobName": "Job-1",
"scheme": "http",
"scrapeInterval": "15m",
"scrapeTimeout": "1m",
"metricsPath": "/metrics"
}

Send this PATCH request and your job and target will be changed to the new URL, to 15 minutes scrape interval and 1 minute scrape timeout.

You must specify the Job name you want to delete in the following URL: https://argus.api.eu01.stackit.cloud/v1/projects/[projectId]/instances/[instanceId]/scrapeconfigs/[jobName].

Then you can send a HTTP DELETE request.

Please consult the official API documentation for in depth information on the expected request.

You cannot use the delete request for this, as it is only possible for deleting an entire job. To delete a target, you must change the job.