Skip to content

Instantly share code, notes, and snippets.

@tashian
Last active September 26, 2024 05:24
Show Gist options
  • Save tashian/4e9ab9c5dcecc70946a9ae2a0e0044c3 to your computer and use it in GitHub Desktop.
Save tashian/4e9ab9c5dcecc70946a9ae2a0e0044c3 to your computer and use it in GitHub Desktop.
Prometheus configuration file with TLS support
# my global config
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']
- job_name: 'nodes'
scheme: https
tls_config:
cert_file: '/etc/prometheus/client.crt'
key_file: '/etc/prometheus/client.key'
ca_file: '/etc/prometheus/root_ca.crt'
file_sd_configs:
- files:
- 'targets/nodes.json'
@Raj4IBM
Copy link

Raj4IBM commented Sep 26, 2024

Hi I have already TLS enabled with the help of your above code , now i need to renew a signed certificate . Can you let me know the steps and configuration for the Cert renewal .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment