Skip to content

Correct HTTP Push end point - #101

Closed
meetme2meat wants to merge 1 commit into
prometheus:masterfrom
meetme2meat:correct-http-push-endpoint
Closed

Correct HTTP Push end point#101
meetme2meat wants to merge 1 commit into
prometheus:masterfrom
meetme2meat:correct-http-push-endpoint

Conversation

@meetme2meat

Copy link
Copy Markdown

As of 0.7.0 the HTTP push endpoint has been changed from /jobs/ -> /job/.

This pull request attempt to correct that.

…n /job/. This commit attempt to address this

Signed-off-by: Viren Negi <meetme2meat@gmail.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling c0eaf93 on meetme2meat:correct-http-push-endpoint into 300de85 on prometheus:master.

@coveralls

coveralls commented Jan 18, 2019

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 464aa05 on meetme2meat:correct-http-push-endpoint into 300de85 on prometheus:master.

@beorn7
beorn7 requested a review from grobie January 21, 2019 19:45
PATH = '/metrics/jobs/%s'.freeze
INSTANCE_PATH = '/metrics/jobs/%s/instances/%s'.freeze
PATH = '/metrics/job/%s'.freeze
INSTANCE_PATH = '/metrics/job/%s/instances/%s'.freeze

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/instances/instance/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beorn7 I can change that but I do seem to find the anything mentioned in the README.md regarding the instances thing?

push = Prometheus::Client::Push.new('bar-job', 'foo')

expect(push.path).to eql('/metrics/jobs/bar-job/instances/foo')
expect(push.path).to eql('/metrics/job/bar-job/instances/foo')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/instances/instance/

push = Prometheus::Client::Push.new('bar job', 'foo <my instance>')

expected = '/metrics/jobs/bar%20job/instances/foo%20%3Cmy%20instance%3E'
expected = '/metrics/job/bar%20job/instances/foo%20%3Cmy%20instance%3E'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/instances/instance/

@beorn7

beorn7 commented Jan 21, 2019

Copy link
Copy Markdown
Contributor

Note that this is the same as #99 and #97 .

@grobie could you shepherd this into a solution? Note that Pushgateway v0.7 doesn't support the legacy paths anymore.

@Eric-Fontana-Bose

Copy link
Copy Markdown

Shouldn’t it be instance (singular) not instances ? See https://github.com/prometheus/pushgateway/pull/227/files

@beorn7

beorn7 commented Jan 24, 2019

Copy link
Copy Markdown
Contributor

It can be anything, but with the current endpoint, if you use /instances/foo, you will push with a label instances="foo" rather than instance="foo".

Thus, if you still want to push an instance tag (which is not recommended in general), you need to use /instance/ in the path, even if /instances/ is technically possible.

@meetme2meat

meetme2meat commented Jan 24, 2019

Copy link
Copy Markdown
Author

@beorn7 Yes, naming it as instance would help in the scenario where we are interested in knowing the instance from where the metric was pushed, else Prometheus db would have instances and instance label.

On the other note, the honour_labels options which I planning to use on prometheus_scarper will fail if it stays as instances.

@beorn7 I can make the change. If my appeal sounds reasonable to you.

@beorn7

beorn7 commented Jan 24, 2019

Copy link
Copy Markdown
Contributor

The minimum fix of client_ruby is to do s/jobs/job/ and s/instances/instance/ without changing the function signature. Deprecation of pushing with an instance label can be done separately.

@grobie is the maintainer and has to shepherd this.

@beorn7 beorn7 mentioned this pull request Jan 25, 2019
@beorn7

beorn7 commented Jan 25, 2019

Copy link
Copy Markdown
Contributor

I talked to @grobie and @stuartnelson3 and created #102 with the suggested changes. Thus, this has been superseded. My apologies for the slow processing. We should have done a better job as maintainers.

@beorn7 beorn7 closed this Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants