You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "boomanaiden154 (via GitHub)" <gi...@apache.org> on 2024/09/15 06:04:33 UTC
[PR] Add information on python metrics to the programming guide [beam]
boomanaiden154 opened a new pull request, #32464:
URL: https://github.com/apache/beam/pull/32464
This patch adds documentation within the programming guide on how to use Beam metrics within Python as before this patch the only two languages with such information were Go and Java. This prevents the need to look at specific examples (or needing to read the source code) to learn how to use metrics in Python.
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add information on python metrics to the programming guide [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32464:
URL: https://github.com/apache/beam/pull/32464#issuecomment-2351465676
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @rszper for label website.
Available commands:
- `stop reviewer notifications` - opt out of the automated review tooling
- `remind me after tests pass` - tag the comment author after tests pass
- `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
The PR bot will only process comments in the main thread (not review comments).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add information on python metrics to the programming guide [beam]
Posted by "melap (via GitHub)" <gi...@apache.org>.
melap merged PR #32464:
URL: https://github.com/apache/beam/pull/32464
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add information on python metrics to the programming guide [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32464:
URL: https://github.com/apache/beam/pull/32464#issuecomment-2351411092
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add information on python metrics to the programming guide [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32464:
URL: https://github.com/apache/beam/pull/32464#issuecomment-2353701932
R: @melap for final approval
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add information on python metrics to the programming guide [beam]
Posted by "rszper (via GitHub)" <gi...@apache.org>.
rszper commented on code in PR #32464:
URL: https://github.com/apache/beam/pull/32464#discussion_r1761588579
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
Review Comment:
```suggestion
`PipelineResult` has a `metrics` method that returns a `MetricResults` object. The `MetricResults` object lets you
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
Review Comment:
```suggestion
access metrics. The main method available in the `MetricResults` object, `query`, lets you
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
Review Comment:
```suggestion
query all metrics that match a given filter. The `query` method takes in a `MetricsFilter` object that you can
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
+be constructed to filter by several different criteria. Querying a `MetricResults` object returns
+a dictionary of lists of `MetricResult` objects, with the dictionary organizing them by type
+(e.g., Counter, Distribution, and Gauge). The `MetricResult` object contains a `result()` function
Review Comment:
```suggestion
for example, `Counter`, `Distribution`, and `Gauge`. The `MetricResult` object contains a `result` function
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
+be constructed to filter by several different criteria. Querying a `MetricResults` object returns
+a dictionary of lists of `MetricResult` objects, with the dictionary organizing them by type
+(e.g., Counter, Distribution, and Gauge). The `MetricResult` object contains a `result()` function
+that gets the value of the metric, and contains a `key` property that contains information on
Review Comment:
```suggestion
that gets the value of the metric and contains a `key` property. The `key` property contains information about
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
+be constructed to filter by several different criteria. Querying a `MetricResults` object returns
Review Comment:
```suggestion
use to filter by several different criteria. Querying a `MetricResults` object returns
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
+be constructed to filter by several different criteria. Querying a `MetricResults` object returns
+a dictionary of lists of `MetricResult` objects, with the dictionary organizing them by type
Review Comment:
```suggestion
a dictionary of lists of `MetricResult` objects, with the dictionary organizing them by type,
```
##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -6159,6 +6191,17 @@ matching a given filter. It takes in a predicate with a `SingleResult` paramete
be used for custom filters.
{{< /paragraph >}}
+{{< paragraph class="language-py">}}
+`PipelineResult` has a method `metrics()` which returns a `MetricResults` object that allows
+accessing metrics. The main method available in a `MetricResults` object, `query()`, allows
+for querying all metrics matching a given filter. It takes in a `MetricsFilter` object that can
+be constructed to filter by several different criteria. Querying a `MetricResults` object returns
+a dictionary of lists of `MetricResult` objects, with the dictionary organizing them by type
+(e.g., Counter, Distribution, and Gauge). The `MetricResult` object contains a `result()` function
+that gets the value of the metric, and contains a `key` property that contains information on
+the namespace and name of the metric.
Review Comment:
```suggestion
the namespace and the name of the metric.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org