Skip to content

How to add go runtime metrics, with self-define label? #1585

Closed
@jencoldeng

Description

@jencoldeng

I use prom client juest like this:

`
package main

import (
"net/http"

"github.com/prometheus/client_golang/prometheus/promhttp"
)

func main() {
// Serve the default Prometheus metrics registry over HTTP on /metrics.
http.Handle("/metrics", promhttp.Handler())
http.ListenAndServe(":8080", nil)
}
`

It includes go runtime sdk. But how can I define my own label to each metric? Like serviceName, agentIp, and so on.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions