Skip to content

[BEAM-6361][BEAM-6364] fix user-metric-prefix checking in Flink portable metrics update - #7408

Merged
mxm merged 2 commits into
apache:masterfrom
ryan-williams:flink
Jan 25, 2019
Merged

mxm merged 2 commits into
apache:masterfrom
ryan-williams:flink

Conversation

@ryan-williams

@ryan-williams ryan-williams commented Jan 3, 2019 •

Copy link
Copy Markdown
Contributor

two small follow-ups to #7183:

  • BEAM-6361: fix incorrect user-metric-prefix check
  • BEAM-6364: WARN instead of throw on as-yet-unsupported metrics types

They're each pretty small, and the tests of the latter depend on the former, so I put them both in this PR; let me know if it would be better if I split them out.

R: @ajamato
R: @robertwb (we'd previously discussed the BEAM-6364 portion of this in particular)

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

when(metricGroup.counter("ns1.metric1")).thenReturn(userCounter);

SimpleCounter elemCounter = new SimpleCounter();
when(metricGroup.counter("beam.metric:element_count:v1")).thenReturn(elemCounter);

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.

The current namespace parsing logic above just takes the everything after the first : as the "name", so this name is metric:element_count:v1.

I don't see any reason that having additional :s in the "name" is a problem, but I saw a note about it (only related to user metrics, though) in SimpleMonitoringInfoBuilder, so open to whether there's a better way to think about it here.

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.

I suppose user-defined counters should not be able to change the namespace via colons.

@ryan-williams ryan-williams changed the title [BEAM-6361] fix user-metric-prefix checking in Flink portable metrics update [BEAM-6361][BEAM-6364] fix user-metric-prefix checking in Flink portable metrics update Jan 4, 2019
@ryan-williams

ryan-williams commented Jan 4, 2019 •

Copy link
Copy Markdown
Contributor Author

python failure seems unrelated, and the same as in 3385 (#7416), 3382 (#7300), 3370 (#7407), and perhaps others

======================================================================
FAIL: test_error_traceback_includes_user_code (apache_beam.runners.portability.portable_runner_test.PortableRunnerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/fn_api_runner_test.py", line 473, in test_error_traceback_includes_user_code
    self.assertIn('second', message)
AssertionError: 'second' not found in 'Traceback (most recent call last):\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/fn_api_runner_test.py", line 466, in test_error_traceback_includes_user_code\n    p | beam.Create([0]) | beam.Map(first)  # pylint: disable=expression-not-assigned\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/pipeline.py", line 425, in __exit__\n    self.run().wait_until_finish()\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/portable_runner.py", line 316, in wait_until_finish\n    self._job_id, self._state, self._last_error_message()))\nRuntimeError: Pipeline job-7dd476c6-fc08-41b1-8516-86e218de84b1 failed in state FAILED: start <DataInputOperation receivers=[ConsumerSet[Create/Read/Impulse.out0, coder=WindowedValueCoder[BytesCoder], len(consumers)=1]]>\n'
-------------------- >> begin captured logging << --------------------

@ryan-williams

Copy link
Copy Markdown
Contributor Author

Run Python PreCommit

@boyuanzz

boyuanzz commented Jan 4, 2019

Copy link
Copy Markdown
Contributor

python failure seems unrelated, and the same as in 3385 (#7416), 3382 (#7300), 3370 (#7407), and perhaps others

======================================================================
FAIL: test_error_traceback_includes_user_code (apache_beam.runners.portability.portable_runner_test.PortableRunnerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/fn_api_runner_test.py", line 473, in test_error_traceback_includes_user_code
    self.assertIn('second', message)
AssertionError: 'second' not found in 'Traceback (most recent call last):\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/fn_api_runner_test.py", line 466, in test_error_traceback_includes_user_code\n    p | beam.Create([0]) | beam.Map(first)  # pylint: disable=expression-not-assigned\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/pipeline.py", line 425, in __exit__\n    self.run().wait_until_finish()\n  File "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit@2/src/sdks/python/apache_beam/runners/portability/portable_runner.py", line 316, in wait_until_finish\n    self._job_id, self._state, self._last_error_message()))\nRuntimeError: Pipeline job-7dd476c6-fc08-41b1-8516-86e218de84b1 failed in state FAILED: start <DataInputOperation receivers=[ConsumerSet[Create/Read/Impulse.out0, coder=WindowedValueCoder[BytesCoder], len(consumers)=1]]>\n'
-------------------- >> begin captured logging << --------------------

This error is tracking in https://issues.apache.org/jira/browse/BEAM-6280.

@mxm mxm left a comment

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.

Looks good to me. Just a minor comment.

when(metricGroup.counter("ns1.metric1")).thenReturn(userCounter);

SimpleCounter elemCounter = new SimpleCounter();
when(metricGroup.counter("beam.metric:element_count:v1")).thenReturn(elemCounter);

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.

I suppose user-defined counters should not be able to change the namespace via colons.

@angoenka

Copy link
Copy Markdown
Contributor

Run Portable_Python PreCommit

@ryan-williams

Copy link
Copy Markdown
Contributor Author

Run Java PreCommit

@ryan-williams

Copy link
Copy Markdown
Contributor Author
org.apache.beam.sdk.io.elasticsearch.ElasticsearchIOTest > testWriteRetryValidRequest FAILED
    java.lang.AssertionError at ElasticsearchIOTest.java:219

@mxm

mxm commented Jan 25, 2019

Copy link
Copy Markdown
Contributor

If it's only that test failing, it's fine to merge. All other tests still run.

@ryan-williams

ryan-williams commented Jan 25, 2019 •

Copy link
Copy Markdown
Contributor Author

Looks like everything passed the second time around, so this should be good to go

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.

4 participants