Skip to content

UI for Jobs and Scrape Configs in Target Allocator Server #3622

@CharlieTLe

Description

@CharlieTLe

Component(s)

target allocator

Is your feature request related to a problem? Please describe.

There's a way to see the jobs and scrape configs that have been discovered via the Prometheus Operator CRDs on the Target Allocator's HTTP Endpoints as described in the documentation.

#### Endpoints
`/scrape_configs`:
```json
{
"job1": {
"follow_redirects": true,
"honor_timestamps": true,
"job_name": "job1",
"metric_relabel_configs": [],
"metrics_path": "/metrics",
"scheme": "http",
"scrape_interval": "1m",
"scrape_timeout": "10s",
"static_configs": []
},
"job2": {
"follow_redirects": true,
"honor_timestamps": true,
"job_name": "job2",
"metric_relabel_configs": [],
"metrics_path": "/metrics",
"relabel_configs": [],
"scheme": "http",
"scrape_interval": "1m",
"scrape_timeout": "10s",
"kubernetes_sd_configs": []
}
}
```
`/jobs`:
```json
{
"job1": {
"_link": "/jobs/job1/targets"
},
"job2": {
"_link": "/jobs/job1/targets"
}
}
```
`/jobs/{jobID}/targets`:
```json
{
"collector-1": {
"_link": "/jobs/job1/targets?collector_id=collector-1",
"targets": [
{
"Targets": [
"10.100.100.100",
"10.100.100.101",
"10.100.100.102"
],
"Labels": {
"namespace": "a_namespace",
"pod": "a_pod"
}
}
]
}
}
```
`/jobs/{jobID}/targets?collector_id={collectorID}`:
```json
[
{
"targets": [
"10.100.100.100",
"10.100.100.101",
"10.100.100.102"
],
"labels": {
"namespace": "a_namespace",
"pod": "a_pod"
}
}
]
```

The JSON that is returned is not pretty and requires some formatting on behalf of the user for any form of interaction. There are _link properties, but they require copy and pasting to find out more information about the job/collector. This can be tedious and adds friction in the process of understanding how the targets are allocated.

Describe the solution you'd like

When these pages are navigated to via the browser, the information like the discovered targets and where they have been allocated should be formatted with some HTML to make it human readable.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions