Hi Brian ,

Thanks for your inputs .

*Prometheus.yaml file for postgresql exporter job . *

- job_name:
postgres_exporter_agent_id_21c040c5-614e-4b17-998f-4b59cdf698c_lr-1m0s

#  honor_timestamps: false

  params:

    collect[]:

    - custom_query.lr

  scrape_interval: 10s

  scrape_timeout: 10s

  metrics_path: /metrics

  static_configs:

  - targets:

    - x.x.x.x:9187

    labels:

      agent_id: /agent_id/21c040c5-614e-4b17-998f-4b59cdf698cc

      agent_type: postgres_exporter

      instance: /agent_id/21c040c5-614e-4b17-998f-4b59cdf698cc

      machine_id: /machine_id/34d94f29d2014e109ce67debbd39d9f5

      node_id:  /node_id/d4a79274-d151-44a2-9c15-a0f0535b729f

      node_name: ip-x-x-x-x

      node_type: generic

      region: sgp1



   - Checked the endpoints status and it's showing up over prometheus UI
   under target section .


*Postgres Exporter Debug logs : *

root@ip-x-x-x-x:/usr/local/bin# /usr/local/bin/postgres_exporter
--web.listen-address=x.x.x.x:9187 --log.level=debug
--web.telemetry-path=/metrics

INFO[0000] Starting postgres_exporter (version=, branch=, revision=)  source
="postgres_exporter.go:1457"

INFO[0000] Build context (go=go1.13.8, user=, date=)     source
="postgres_exporter.go:1458"

INFO[0000] Established new database connection to "localhost:5432".  source
="postgres_exporter.go:798"

DEBU[0000] Querying Postgres Version on "localhost:5432"  source
="postgres_exporter.go:1241"

INFO[0000] Semantic Version Changed on "localhost:5432": 0.0.0 -> 10.12.0
source="postgres_exporter.go:1258"

DEBU[0000] pg_xlog_location_diff is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] procpid is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] write_location is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] sent_location is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] flush_location is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] replay_location is being forced to discard due to version
incompatibility.  source="postgres_exporter.go:525"

DEBU[0000] Querying pg_setting view on "localhost:5432"  source
="pg_setting.go:15"

DEBU[0000] Querying namespace:  pg_stat_bgwriter         source
="postgres_exporter.go:1221"

DEBU[0000] Querying namespace:  pg_stat_database         source
="postgres_exporter.go:1221"

DEBU[0000] Querying namespace:  pg_stat_database_conflicts  source
="postgres_exporter.go:1221"

DEBU[0000] Querying namespace:  pg_locks                 source
="postgres_exporter.go:1221"

DEBU[0000] Querying namespace:  pg_stat_replication      source
="postgres_exporter.go:1221"

DEBU[0000] Querying namespace:  pg_stat_activity         source
="postgres_exporter.go:1221"

DEBU[0000] Collector "exporter" was registered           source
="postgres_exporter.go:1554"

DEBU[0000] Collector "standard.process" was registered   source
="postgres_exporter.go:1554"

DEBU[0000] Collector "standard.go" was registered        source
="postgres_exporter.go:1554"

INFO[0000] Starting HTTP server for http://x.x.x.x:9187/metrics ...  source
="server.go:140"


*Fetched end points details :*


curl -is http://x.x.x.x:9187/metrics


# HELP pg_exporter_last_scrape_duration_seconds Duration of the last scrape
of metrics from PostgresSQL.

# TYPE pg_exporter_last_scrape_duration_seconds gauge

pg_exporter_last_scrape_duration_seconds 0.015799825

# HELP pg_exporter_last_scrape_error Whether the last scrape of metrics
from PostgreSQL resulted in an error (1 for error, 0 for success).

# TYPE pg_exporter_last_scrape_error gauge

pg_exporter_last_scrape_error 0

# HELP pg_exporter_scrapes_total Total number of times PostgresSQL was
scraped for metrics.

# TYPE pg_exporter_scrapes_total counter

pg_exporter_scrapes_total 4

# HELP pg_locks_count Number of locks

# TYPE pg_locks_count gauge

pg_locks_count{datname="postgres",mode="accessexclusivelock",server="localhost:5432"}
0

pg_locks_count{datname="postgres",mode="accesssharelock",server="localhost:5432"}
1

pg_locks_count{datname="postgres",mode="exclusivelock",server="localhost:5432"}
0

On Fri, Apr 17, 2020 at 12:43 PM Brian Candler <[email protected]> wrote:

> Probably you're not scraping the exporter.  Show you prometheus.yml.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/db264609-c77c-4744-bd91-3a272a7c6bef%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/db264609-c77c-4744-bd91-3a272a7c6bef%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Thanks
*Vinay kumar Jaiswal*
Mobile No:9650526003
Skype:vinayjaiswal1989

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAGbf92g4xRvhD_5Ks2GwhjV5JFNupzZTJWMwHtMbrvWm8tCBqg%40mail.gmail.com.

Reply via email to