|
68 | 68 |
|
69 | 69 | g_is_serverless = False |
70 | 70 |
|
71 | | -g_serverless_cluster_endpoint_pattern = r"(.+)\.(.+)\.(.+).redshift-serverless(-dev)?\.amazonaws\.com:[0-9]{4,5}\/(.)+" |
72 | | -g_cluster_endpoint_pattern = r"(.+)\.(.+)\.(.+).redshift(-serverless)?\.amazonaws\.com:[0-9]{4,5}\/(.)+" |
| 71 | +g_serverless_cluster_endpoint_pattern = ( |
| 72 | + r"(.+)\.(.+)\.(.+).redshift-serverless(-dev)?\.amazonaws\.com:[0-9]{4,5}\/(.)+" |
| 73 | +) |
| 74 | +g_cluster_endpoint_pattern = ( |
| 75 | + r"(.+)\.(.+)\.(.+).redshift(-serverless)?\.amazonaws\.com:[0-9]{4,5}\/(.)+" |
| 76 | +) |
73 | 77 |
|
74 | 78 |
|
75 | 79 | class ConnectionLog: |
@@ -393,11 +397,15 @@ def save_query_stats(self, starttime, endtime, xid, query_idx): |
393 | 397 | ) |
394 | 398 |
|
395 | 399 | def get_tagged_sql(self, query_text, idx, transaction, connection): |
396 | | - json_tags = { |
397 | | - "xid": transaction.xid, |
398 | | - "query_idx": idx, |
399 | | - "replay_start": g_replay_timestamp.isoformat(), |
400 | | - } |
| 400 | + if g_config.get("source_tag", None): |
| 401 | + json_tags = { |
| 402 | + "xid": transaction.xid, |
| 403 | + "query_idx": idx, |
| 404 | + "replay_start": g_replay_timestamp.isoformat(), |
| 405 | + "source": g_config.get('source_tag', 'SimpleReplay'), |
| 406 | + } |
| 407 | + |
| 408 | + |
401 | 409 | return "/* {} */ {}".format(json.dumps(json_tags), query_text) |
402 | 410 |
|
403 | 411 | def execute_transaction(self, transaction, connection): |
@@ -2262,7 +2270,7 @@ def init_manager(): |
2262 | 2270 | logger.info( |
2263 | 2271 | f"Replay finished in {datetime.datetime.now(tz=datetime.timezone.utc) - g_replay_timestamp}." |
2264 | 2272 | ) |
2265 | | - |
| 2273 | + |
2266 | 2274 | if g_config.get("analysis_iam_role") and g_config.get("analysis_output"): |
2267 | 2275 | try: |
2268 | 2276 | run_replay_analysis( |
|
0 commit comments