Skip to content

Commit 113975f

Browse files
authored
[chore] Use debug loglevel for github metrics script (openvinotoolkit#23633)
### Details: We can switch log level for GitHub metrics script only when the workflow is restarted with debug logging
1 parent 908dac9 commit 113975f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

.github/scripts/collect_github_metrics.py

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def main():
112112
repo = g.get_repo(repo_name)
113113

114114
run = repo.get_workflow_run(int(run_id))
115+
logger.debug('Processing run ID %s - %s', run_id, run.name)
115116
if run.status != 'completed':
116117
logger.error('Run %s is not completed! Only completed runs should be in the database', run_id)
117118
raise SystemExit(1)
@@ -144,6 +145,7 @@ def main():
144145

145146
for job in run.jobs():
146147
job_id = job.id
148+
logger.debug('Processing job %s', job.name)
147149
queued_duration_seconds = 0
148150
duration_seconds = 0
149151

@@ -178,6 +180,7 @@ def main():
178180
logger.debug('Job query: %s', job_data_query)
179181
cur.execute(job_data_query)
180182
for step in job.steps:
183+
logger.debug('Processing step %s', step.name)
181184
duration_seconds_timedelta = step.completed_at - step.started_at
182185
duration_seconds = round(duration_seconds_timedelta.total_seconds())
183186

.github/workflows/send_workflows_to_opentelemetry.yml

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ jobs:
6262
PGPASSWORD: ${{ secrets.METRICS_DATABASE_PASSWORD }}
6363
PGDATABASE: ${{ secrets.METRICS_DATABASE_NAME }}
6464
PGPORT: 5432
65+
# LOGLEVEL: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}"
66+
LOGLEVEL: DEBUG
6567
run: |
6668
python3 .github/scripts/collect_github_metrics.py \
6769
--run-id ${{ github.event.workflow_run.id }} \

0 commit comments

Comments
 (0)