Skip to content

Problem when pushing using golang client - invalid metric name #48

@bzon

Description

@bzon

Version: github.com/prometheus/client_golang v1.5.1

Code:

import (
	"github.com/prometheus/client_golang/prometheus/push"
	"github.com/prometheus/client_golang/prometheus"
)

	pusher := push.New(
		"http://localhost:9091",
		"foo-job",
	).Gatherer(prometheus.DefaultGatherer)

	if err := pusher.Push(); err != nil {
		fmt.Println(err)
	}

Error:

unexpected status code 400 while pushing to http://localhost:9091/metrics/job/foo-job: text format parsing error in line 1: invalid metric name

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