Skip to content

Prometheus as data source in Grafana #2237

@miparnisari

Description

@miparnisari

To expose Prometheus metrics in a Go application, you need to provide a `/metrics` HTTP endpoint. You can use the [`prometheus/promhttp`](https://godoc.org/github.com/prometheus/client_golang/prometheus/promhttp) library's HTTP [`Handler`](https://godoc.org/github.com/prometheus/client_golang/prometheus/promhttp#Handler) as the handler function.

After following this guide, i have Prometheus data at http://localhost:2112/metrics.

However, if I try to add Prometheus as a data source in Grafana, Grafana tries to query api/v1/query, which doesn't have anything.

image

What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions