Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring doc #611

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions doc/monitoring/prometheus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## Monitoring

Instaclustr allows you scrap clusters metrics via its Monitoring API.

If you use [Prometheus-Operator](https://github.com/prometheus-operator/prometheus-operator) as your monitoring system:

There are two ways of configuring Prometheus to scrap Instaclustr metrics:
1. By creating a configuration file and providing it to the Prometheus Operator by passing a secret with configuration of the job

A template of the job config:
```yaml
- job_name: instaclustr_prometheus
scheme: https
http_sd_configs:
- url: https://{ACCOUNT_ID}.prometheus.monitoring.dev.instaclustr.com/discovery/v1/
basic_auth:
#get from account settings page
username: {USERNAME}
password: {MONITORING_API_KEY}
metrics_path: 'metrics/v2/query'
basic_auth:
#get from account settings page
username: {USERNAME}
password: {MONITORING_API_KEY}
```

Creating a secret which contains the described config:
```shell
kubectl create secret generic {your-secret-name} --from-file={your-config.yaml}
```

By updating your prometheus with the following configuration will allow your prometheus to
scrap metrics of your clusters on Instaclustr:
```yaml
# Your prometheus manifest
additionalScrapeConfigs:
name: {your-secret-name}
key: {your-config.yaml}
```

2. If your prometheus is deployed via Helm everything is getting easier.

In your `values.yaml` file which stores the configuration of the whole kube-prometheus-stack just add the following
settings to the configuration of prometheus:

```yaml
additionalScrapeConfigs:
- job_name: instaclustr_prometheus
scheme: https
http_sd_configs:
- url: https://{ACCOUNT_ID}.prometheus.monitoring.dev.instaclustr.com/discovery/v1/
basic_auth:
#get from account settings page
username: {USERNAME}
password: {MONITORING_API_KEY}
metrics_path: 'metrics/v2/query'
basic_auth:
#get from account settings page
username: {USERNAME}
password: {MONITORING_API_KEY}
```

It will create a secret which stores the following jobs configuration and provide it to the prometheus.

If you want to scrap metrics from a specific cluster just provide its `clusterId` to the url:
```yaml
http_sd_configs:
- url: https://{ACCOUNT_ID}.prometheus.monitoring.dev.instaclustr.com/discovery/v1/{CLUSTER_ID}
```

If you want to read more about Instaclustr Metrics and configuring of Prometheus please
follow our [doc](https://www.instaclustr.com/support/api-integrations/integrations/instaclustr-monitoring-with-prometheus/).