[
https://issues.apache.org/jira/browse/BEAM-11986?focusedWorklogId=653809&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-653809
]
ASF GitHub Bot logged work on BEAM-11986:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 21/Sep/21 20:44
Start Date: 21/Sep/21 20:44
Worklog Time Spent: 10m
Work Description: ajamato commented on a change in pull request #15294:
URL: https://github.com/apache/beam/pull/15294#discussion_r713402051
##########
File path: sdks/python/apache_beam/io/gcp/experimental/spannerio.py
##########
@@ -320,6 +330,42 @@ def __init__(self, spanner_configuration):
self._spanner_configuration = spanner_configuration
self._snapshot = None
self._session = None
+ self.base_labels = {
+ monitoring_infos.SERVICE_LABEL: 'Spanner',
+ monitoring_infos.METHOD_LABEL: 'Read',
+ monitoring_infos.SPANNER_PROJECT_ID: self._spanner_configuration.
+ project,
+ monitoring_infos.SPANNER_DATABASE_ID: self._spanner_configuration.
+ database,
+ }
+
+ def _table_metric(self, table_id, status):
+ database_id = self._spanner_configuration.database
+ project_id = self._spanner_configuration.project
+ resource = resource_identifiers.SpannerTable(
+ project_id, database_id, table_id)
+ labels = {
+ **self.base_labels,
+ monitoring_infos.RESOURCE_LABEL: resource,
+ monitoring_infos.SPANNER_TABLE_ID: table_id
+ }
+ service_call_metric = ServiceCallMetric(
Review comment:
ServiceCallMetric by design must be instantiated before the IO(spanner)
API call is made to the IO source/sink.
This is because we intened to use it to also time the IO(spanner) API calls.
Then the .call() should be made once the IO(spanner) API call returns
##########
File path: sdks/python/apache_beam/io/gcp/experimental/spannerio.py
##########
@@ -523,6 +585,42 @@ class _ReadFromPartitionFn(DoFn):
"""
def __init__(self, spanner_configuration):
self._spanner_configuration = spanner_configuration
+ self.base_labels = {
+ monitoring_infos.SERVICE_LABEL: 'Spanner',
+ monitoring_infos.METHOD_LABEL: 'Read',
+ monitoring_infos.SPANNER_PROJECT_ID: self._spanner_configuration.
Review comment:
Please use this style, avoid breaking the
self._spanner_configuration.project into mutliple lines
monitoring_infos.SPANNER_PROJECT_ID: (
self._spanner_configuration.project),
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 653809)
Time Spent: 5h 40m (was: 5.5h)
> Python Spanner - Implement IO Request Count metric
> --------------------------------------------------
>
> Key: BEAM-11986
> URL: https://issues.apache.org/jira/browse/BEAM-11986
> Project: Beam
> Issue Type: Test
> Components: io-py-gcp
> Reporter: Alex Amato
> Priority: P3
> Time Spent: 5h 40m
> Remaining Estimate: 0h
>
> Reference PRs (See BigQuery IO example) and detailed explanation of what's
> needed to instrument this IO with Request Count metrics is found in this
> handoff doc:
> [https://docs.google.com/document/d/1lrz2wE5Dl4zlUfPAenjXIQyleZvqevqoxhyE85aj4sc/edit'|https://docs.google.com/document/d/1lrz2wE5Dl4zlUfPAenjXIQyleZvqevqoxhyE85aj4sc/edit'?authuser=0]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)