Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/metrics/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class MetricNameLengthExemptionWarning(Warning):
r"^ti.finish.(?P<dag_id>.*)\.(?P<task_id>.*)\.(?P<state>.*)$",
r"^task_removed_from_dag\.(?P<dag_id>.*)$",
r"^task_restored_to_dag\.(?P<dag_id>.*)$",
r"^task_instance_created-(?P<operator_name>.*)$",
r"^task_instance_created_(?P<operator_name>.*)$",
r"^dag_processing\.last_run\.seconds_ago\.(?P<dag_file>.*)$",
r"^pool\.open_slots\.(?P<pool_name>.*)$",
r"^pool\.queued_slots\.(?P<pool_name>.*)$",
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ def _create_task_instances(
session.bulk_save_objects(tasks)

for task_type, count in created_counts.items():
Stats.incr(f"task_instance_created-{task_type}", count, tags=self.stats_tags)
Stats.incr(f"task_instance_created_{task_type}", count, tags=self.stats_tags)
# Same metric with tagging
Stats.incr("task_instance_created", count, tags={**self.stats_tags, "task_type": task_type})
session.flush()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Name Descripti
``task_removed_from_dag.<dag_id>`` Number of tasks removed for a given dag (i.e. task no longer exists in DAG)
``task_restored_to_dag.<dag_id>`` Number of tasks restored for a given dag (i.e. task instance which was
previously in REMOVED state in the DB is added to DAG file)
``task_instance_created-<operator_name>`` Number of tasks instances created for a given Operator
``task_instance_created_<operator_name>`` Number of tasks instances created for a given Operator
``triggers.blocked_main_thread`` Number of triggers that blocked the main thread (likely due to not being
fully asynchronous)
``triggers.failed`` Number of triggers that errored before they could fire an event
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_otel_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_invalid_stat_names_are_caught(self, invalid_stat_combo):
self.meter.assert_not_called()

def test_old_name_exception_works(self, caplog):
name = "task_instance_created-OperatorNameWhichIsSuperLongAndExceedsTheOpenTelemetryCharacterLimit"
name = "task_instance_created_OperatorNameWhichIsSuperLongAndExceedsTheOpenTelemetryCharacterLimit"
assert len(name) > OTEL_NAME_MAX_LENGTH

with pytest.warns(MetricNameLengthExemptionWarning):
Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ def test_verify_integrity_task_start_and_end_date(Stats_incr, session, run_type,
assert len(tis) == expected_tis

Stats_incr.assert_any_call(
"task_instance_created-EmptyOperator", expected_tis, tags={"dag_id": "test", "run_type": run_type}
"task_instance_created_EmptyOperator", expected_tis, tags={"dag_id": "test", "run_type": run_type}
)
Stats_incr.assert_any_call(
"task_instance_created",
Expand Down