Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Prometheus 101

Prometheus 101

On this talk I gave a basic introduction to Prometheus and how can we use it to monitor our services.

I presented this talk both on TDC 2019 and on Tchê Linux 2019.

Sebastian Webber

December 14, 2019
Tweet

More Decks by Sebastian Webber

Other Decks in Technology

Transcript

  1. Prometheus 101
    Sebastian Webber

    View Slide

  2. $ whoami
    ● Consultant @timbira
    ● Senior DB Engineer
    @caremessage
    ● Student @bujinkan

    View Slide

  3. http://bit.ly/cfp-dod-poa

    View Slide

  4. Prometheus
    https://prometheus.io/

    View Slide

  5. Service discovery
    ● Azure VMs
    ● Consul
    ● DNS
    ● AWS EC2 Instances
    ● OpenStack Nova instances
    ● Files
    ● GCP GCE Instances
    ● Kuberentes nodes, services,
    pods, endpoints, and ingresses
    ● Marathon
    ● Nerve
    ● … and others
    What is
    Prometheus? Database
    It’s a time series
    database.
    API
    All integrations are
    done by the REST
    API
    WEB UI
    It contains an ugly,
    but useful interface
    to check the
    configuration and
    debug PROMQL
    queries.
    Scraper
    service
    Prometheus uses
    jobs to connect on
    the services that
    exports relevant
    data.
    All of this inside only one
    executable file…

    View Slide

  6. Prometheus points
    to lots of exporters to
    get the data

    View Slide

  7. View Slide

  8. how do the
    exporters work?
    http://host:port/metrics
    https://prometheus.io/docs/instrumenting/clientlibs/

    View Slide

  9. and the
    metrics? Given a metric name and a set of labels, time series are
    frequently identified using this notation:
    {=, ...}
    For example, a time series with the metric name
    api_http_requests_total and the labels method="POST"
    and handler="/messages" could be written like this:
    api_http_requests_total{method="POST",
    handler="/messages"}
    This is the same notation that OpenTSDB uses.
    https://prometheus.io/docs/concepts/data_model/

    View Slide

  10. Data types
    Summary
    Histogram
    Gauge
    Counter
    https://prometheus.io/docs/concepts/metric_types

    View Slide

  11. demo
    https://github.com/sebastianwebber/lab-prom-101

    View Slide

  12. wait.. there is more!

    View Slide

  13. View Slide

  14. about grafana

    View Slide

  15. View Slide

  16. View Slide