Skip to main content

Provider and Namespace

Siren provider represents a monitoring server. We define alerts and alerts routing configuration inside providers. For example the below provider, describes how a cortex monitoring server info is stored inside Siren.

# provider
{
"id": "3",
"host": "http://localhost:9009",
"urn": "localhost_cortex",
"name": "localhost_cortex",
"type": "cortex",
"credentials": {},
"created_at": "2021-10-26T06:00:52.627917Z",
"updated_at": "2021-10-26T06:00:52.627917Z"
}

Monitoring providers usually have tenants, a sharded way of storing and querying telemetry data. Siren calls them namespaces. You should create a namespaces with the same name as the tenant of your monitoring providers. Example: the below namespace represent the tenant "odpf".

# namespace
{
"id": "10",
"urn": "odpf",
"name": "odpf",
"provider": {
"id": 3
},
"credentials": {},
"created_at": "2021-10-26T06:00:52.627917Z",
"updated_at": "2021-10-26T06:00:52.627917Z"
}

Provider

Provider creation

$ siren provider create --file provider.yaml

Terminology of the request body

TermDescriptionExample
hostFully qualified path for the providerhttp://localhost:9009
urnUnique name for this provider (uneditable)localhost_cortex
nameName of the proider (editable)localhost_cortex
typetype of the provider(cortex/influx etc.)cortex
credentialskey value pair to be used for authentication with the host{"bearer_token":"x2y4rd5"}
labelskey value pair that can be used as label selector{"environment":"dev"}

The response body will look like this:

{
"id": "1",
"host": "http://localhost:9009",
"urn": "localhost_cortex",
"name": "localhost_cortex",
"type": "cortex",
"credentials": {},
"created_at": "2022-01-03T05:10:47.880209Z",
"updated_at": "2022-01-03T05:10:47.880209Z"
}

Provider update

$ siren provider edit --id 4 --file provider.yaml

Getting a provider

$ siren provider view 1

Getting all providers

$ siren provider list

Deleting a provider

$ siren provider delete 4

Note:

  1. Before deleting the provider, you will need to delete dependant resources (namespaces).

Namespace

Note: These operations on namespaces inside Siren doesn't affect the actual tenant in the monitoring provider. The user should manage the tenants themselves.

Creating a namespace

$ siren namespace create --file namespace.yaml

Terminology of the request body

TermDescriptionExample
urnUnique name for this namespace (uneditable)test-tenant
nameName of the tenant (editable)test-tenant
providerid of the provider to which this tenant belongs1
labelskey value pair that can be used as label selector{"environment":"dev"}
credentialskey value pair to be used for authentication with the host{"bearer_token":"x2y4rd5"}

The response body will look like this:

{
"id": "13",
"urn": "test",
"name": "test",
"provider": "5",
"credentials": {},
"created_at": "2022-01-03T07:06:30.884113Z",
"updated_at": "2022-01-03T07:06:30.884113Z"
}

Updating a namespace

$ siren namespace edit --id 13 --file namespace.yaml

Getting a namespace

$ siren namespace view 13

Getting all namespaces

$ siren namespace list

Deleting a namespace

$ siren namespace delete 13