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

Services are registered in consul successfully,but Prometheus server can't find targets #2835

Closed
empo007 opened this Issue Jun 12, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@empo007
Copy link

empo007 commented Jun 12, 2017

What did you do?
services can be found in consul:

curl http://10.41.31.58:8500/v1/catalog/services

{"P1-cdb-6000-3000":["monType=cdb","userId=l00307136","tenantName=hwAdmin","architectureId=arch123","architectureName=arch123","ipAddress=10.41.31.61","promName=P1","cdbClusterId=clusterdb123","hostname=dggtsp237-or","ipAddress=10.41.31.59","sid=cdbct2","cdbName=cdb123","hostname=dggtsp239-or","sid=cdbctF1","cdbName=cdb234","cdbClusterId=clusterdb234"],"P1-oraCrs-6000-3000":["ipAddress=10.41.31.59","userId=l00307136","poolId=pool1234","hostName=dggtsp237-or","hostname=dggtsp239-or","ipAddress=10.41.31.61","poolId=pool2345","hostname=dggtsp237-or","monType=oraCrs","promName=P1","tenantName=hwAdmin"],"P1-pdb-6000-3000":["cdbName=cdb234","cdbClusterId=clusterdb234","ipAddress=10.41.31.61","hostname=dggtsp237-or","userId=l00307136","architectureId=arch123","pdbName=liqh","ipAddress=10.41.31.59","monType=pdb","sid=cdbct2","cdbClusterId=clusterdb123","pdbId=pdb18","hostname=dggtsp239-or","sid=cdbctF1","promName=P1","tenantName=hwAdmin","cdbName=cdb123","architectureName=arch123"],"consul":[]}

but in target page in prometheus,no targets found

What did you expect to see?
the target page of prometheus server should show all targets.

What did you see instead? Under which circumstances?
no targets found in the target page of prometheus server,my os is linux 64 bit,my prometheus server is the version of 1.6.3
Environment

  • System information:

uname -srm

Linux 2.6.32-573.el6.x86_64 x86_64

  • Prometheus version:

./prometheus -version

prometheus, version 1.6.3 (branch: master, revision: c580b60)
build user: root@a6410e65f5c7
build date: 20170522-09:15:06
go version: go1.8.1

  • Prometheus configuration file:
insert configuration here

I configured Prometheus yml as following:
global:
evaluation_interval: 1m
external_labels: {monitor: P1}
scrape_interval: 60s
scrape_timeout: 30s
rule_files: [alert_rules/*.rules]
scrape_configs:

  • job_name: P1
    metric_relabel_configs:
    • action: drop
      regex: go_.*
      source_labels: [name]
      scrape_interval: 60s
      scrape_timeout: 30s
      static_configs:
      • targets: ['10.41.31.58:8999']
  • consul_sd_configs:
    • {datacenter: orazone-001, server: '10.41.31.58:8500'}
      job_name: overwritten-from-consul
      metric_relabel_configs:
    • action: drop
      regex: go_.*
      source_labels: [name]
      relabel_configs:
    • action: replace
      regex: (.);(.)
      replacement: ${1}:${2}
      separator: ;
      source_labels: [__meta_consul_service_address, __meta_consul_service_port]
      target_label: address
    • action: keep
      regex: ^P1_.*
      source_labels: [__meta_consul_service_id]
    • action: replace
      regex: (?i).,hostname=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: hostname
    • action: replace
      regex: (?i).,ipAddress=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: ipAddress
    • action: replace
      regex: (?i).,userId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: userId
    • action: replace
      regex: (?i).,dbName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: dbName
    • action: replace
      regex: (?i).,instanceName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: instanceName
    • action: replace
      regex: (?i).,monType=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: monType
    • action: replace
      regex: (?i).,promName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: promName
    • action: replace
      regex: (?i).,tenantName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: tenantName
    • action: replace
      regex: (?i).,eMail=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: eMail
    • action: replace
      regex: (?i).,instanceId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: instanceId
    • action: replace
      regex: (?i).,poolId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: poolId
    • action: replace
      regex: (?i).,sid=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: sid
    • action: replace
      regex: (?i).,cdbName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: cdbName
    • action: replace
      regex: (?i).,cdbClusterId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: cdbClusterId
    • action: replace
      regex: (?i).,architectureId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: architectureId
    • action: replace
      regex: (?i).,architectureName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: architectureName
    • action: replace
      regex: (?i).,pdbName=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: pdbName
    • action: replace
      regex: (?i).,pdbId=([^,]+),.
      replacement: ${1}
      source_labels: [__meta_consul_tags]
      target_label: pdbId
      scrape_interval: 60s
      scrape_timeout: 30s
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Jun 12, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 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.