@@ -1825,6 +1825,39 @@ func (ts *IntegrationTestSuite) TestEndToEndLatencyMetrics() {
1825
1825
ts .Equal (prevNonLocalValue , nonLocal .Value ())
1826
1826
}
1827
1827
1828
+ func (ts * IntegrationTestSuite ) TestEndToEndLatencyOnFailureMetrics () {
1829
+ fetchMetrics := func () (localMetric , nonLocalMetric * metrics.CapturedTimer ) {
1830
+ for _ , timer := range ts .metricsHandler .Timers () {
1831
+ timer := timer
1832
+ if timer .Name == "temporal_activity_succeed_endtoend_latency" {
1833
+ nonLocalMetric = timer
1834
+ } else if timer .Name == "temporal_local_activity_succeed_endtoend_latency" {
1835
+ localMetric = timer
1836
+ }
1837
+ }
1838
+ return
1839
+ }
1840
+
1841
+ // Confirm no metrics to start
1842
+ local , nonLocal := fetchMetrics ()
1843
+ ts .Nil (local )
1844
+ ts .Nil (nonLocal )
1845
+
1846
+ // Run regular activity and confirm non-local metric is not emitted
1847
+ err := ts .executeWorkflow ("test-end-to-end-metrics-on-failure-1" , ts .workflows .ActivityRetryOnError , nil )
1848
+ ts .NoError (err )
1849
+ local , nonLocal = fetchMetrics ()
1850
+ ts .Nil (local )
1851
+ ts .Nil (nonLocal )
1852
+
1853
+ // Run local activity and confirm local metric is not emitted
1854
+ err = ts .executeWorkflow ("test-end-to-end-metrics-on-failure-2" , ts .workflows .ActivityRetryOnError , nil )
1855
+ ts .NoError (err )
1856
+ local , nonLocal = fetchMetrics ()
1857
+ ts .Nil (local )
1858
+ ts .Nil (nonLocal )
1859
+ }
1860
+
1828
1861
func (ts * IntegrationTestSuite ) TestGracefulActivityCompletion () {
1829
1862
// FYI, setup of this test allows the worker to wait to stop for 10 seconds
1830
1863
ctx , cancel := context .WithCancel (context .Background ())
0 commit comments