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

Support tls_config section for OpenStack SD #4529

Closed
fedya opened this Issue Aug 23, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@fedya
Copy link

fedya commented Aug 23, 2018

Bug Report

What did you do?
Tryint to collect openstack data with self-signed cert
and i got
could not create OpenStack session: Post https://123.123.123.123:5000/v3/auth/tokens: x509: certificate signed by unknown authority"

Environment
centos7

  • System information:

    Linux 4.17.11-desktop-1omv x86_64

  • Prometheus version:

    prometheus, version 2.3.2

  • Alertmanager version:

    alertmanager, version 0.15.1

  • Prometheus configuration file:

global:
  scrape_interval:     1m
  evaluation_interval: 1m

rule_files:
- /var/lib/prometheus/rules/*.rules
- /var/lib/prometheus/alerts/*.rules

alerting:
  alertmanagers:
  - static_configs:
    - targets:
      - localhost:9093

- job_name: 'openstack'
  openstack_sd_configs:
    - identity_endpoint: https://123.123.123.123:5000/v3
      username: user
      project_name: admin
      region: RegionOne
      domain_name: Default
      password: 123
      role: instance
  • Logs:
level=info ts=2018-08-23T00:20:47.655770615Z caller=main.go:629 msg="Completed loading of configuration file" filename=/etc/prometheus/prometheus.yml
level=info ts=2018-08-23T00:20:47.655799027Z caller=main.go:502 msg="Server is ready to receive web requests."
level=error ts=2018-08-23T00:20:47.662639049Z caller=instance.go:70 component="discovery manager scrape" discovery=openstack msg="Unable to refresh target groups" err="could not create OpenStack session: Post https://123.123.123.123:5000/v3/auth/tokens: x509: certificate signed by unknown authority"
level=error ts=2018-08-23T00:21:47.663941813Z caller=instance.go:87 component="discovery manager scrape" discovery=openstack msg="Unable to refresh target groups" err="could not create OpenStack session: Post https://123.123.123.123:5000/v3/auth/tokens: x509: certificate signed by unknown authority"```
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Aug 23, 2018

What you're looking for is a tls_config section that doesn't exist (yet) for the OpenStack SD. I've rephrased the description accordingly.

IIUC it is somehow possible to override the default HTTP client used by gophercloud (see gophercloud/gophercloud#311)

@simonpasquier simonpasquier changed the title collect openstack data with self-signed cert Support tls_config section for OpenStack SD Aug 23, 2018

@fedya

This comment has been minimized.

Copy link
Author

fedya commented Sep 25, 2018

Patch working fine.
Now i need some user guide, hot to connect prometheus and openstack.
At this moment i got
screenshot_20180925_205059

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Sep 26, 2018

This means that either your endpoint takes too much time to reply or there's some firewall/security group blocking the traffic. What if you do a curl to this URL from the Prometheus server.

@fedya

This comment has been minimized.

Copy link
Author

fedya commented Sep 26, 2018

@simonpasquier
curl http://192.168.1.12:80/metrics
same, just timeout

# nova list
| 27c4a34d-929b-4f53-8f16-7974542ff0da | Vm1  | ACTIVE | -          | Running     | TestP1=192.168.1.12 |

it is internal ip of virtual machine
there is no 80 port available and it is okay.

My config:

- job_name: 'openstack'
  openstack_sd_configs:
    - identity_endpoint: https://10.37.130.103:5000/v3
      username: user
      project_name: admin
      domain_name: Default
      region: RegionOne
      password: pass
      role: instance
      tls_config:
        insecure_skip_verify: true

@lock lock bot locked and limited conversation to collaborators Apr 3, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.