Skip to content

push and pushAdd logic reversed. #137, #138. - #138

Merged
brian-brazil merged 1 commit into
prometheus:masterfrom
rohitagarwal003:push-pushAdd-logic-reversed
Aug 21, 2016
Merged

push and pushAdd logic reversed. #137, #138.#138
brian-brazil merged 1 commit into
prometheus:masterfrom
rohitagarwal003:push-pushAdd-logic-reversed

Conversation

@rohitagarwal003

Copy link
Copy Markdown
Contributor

According to https://github.com/prometheus/pushgateway/blob/0.3.0/README.md#post-method

POST works exactly like the PUT method but only metrics with the same name
as the newly pushed metrics are replaced (among those with the same grouping
key).

According to https://github.com/prometheus/pushgateway/blob/0.3.0/README.md#post-method

> POST works exactly like the PUT method but only metrics with the same name
as the newly pushed metrics are replaced (among those with the same grouping
key).

/**
* Pushes all metrics in a registry, replacing all those with the same job as the grouping key.
* Pushes all metrics in a registry, replacing all those with the same job and no grouping key.

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.

The comment was correct, the job is part of the grouping key.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are three other methods down below with similar signature that say "same job and no grouping key". I think this is to differentiate with the methods which take groupingKey map as argument.

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.

That's just offering them as optional parameters. The grouping key comprises the job label plus whatever other optional labels you add.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know that.

There are eight methods:

1. push(CollectorRegistry registry, String job)
2. push(Collector collector, String job)

3. push(CollectorRegistry registry, String job, Map<String, String> groupingKey)
4. push(Collector collector, String job, Map<String, String> groupingKey)

5. pushAdd(CollectorRegistry registry, String job)
6. pushAdd(Collector collector, String job)

7. pushAdd(CollectorRegistry registry, String job, Map<String, String> groupingKey)
8. pushAdd(Collector collector, String job, Map<String, String> groupingKey)

Methods 1,2,5,6 should have similar documentation. I made the documentation for method 1 similar to what was there for methods 2,5,6.

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.

That makes sense.

@brian-brazil
brian-brazil merged commit 5ca4a6a into prometheus:master Aug 21, 2016
@brian-brazil

Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants