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 full-size slide

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

    View full-size slide

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

    View full-size slide

  4. Prometheus
    https://prometheus.io/

    View full-size 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  8. 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 full-size slide

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

    View full-size slide

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

    View full-size slide

  11. wait.. there is more!

    View full-size slide

  12. about grafana

    View full-size slide