[ 
https://issues.apache.org/jira/browse/BEAM-11986?focusedWorklogId=655621&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-655621
 ]

ASF GitHub Bot logged work on BEAM-11986:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Sep/21 17:03
            Start Date: 27/Sep/21 17:03
    Worklog Time Spent: 10m 
      Work Description: roger-mike commented on a change in pull request #15294:
URL: https://github.com/apache/beam/pull/15294#discussion_r716882573



##########
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:
       Done

##########
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:
       Done




-- 
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: 655621)
    Time Spent: 6.5h  (was: 6h 20m)

> 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: 6.5h
>  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)

Reply via email to