**Description**


It would be great if the metrics we publish in Airflow change to include TAGs for "variable" parts of those (such as dag_id, task_id, pool name) rather than being part of the metrics.

See here: https://airflow.apache.org/docs/1.10.12/metrics.html, https://airflow.readthedocs.io/en/latest/logging-monitoring/metrics.html  - those variable parts should be tags.

We might consider to change those metrics by default in 2.0 and possibly introduce a backport in 1.10.13 to allow people to migrate.


**Use case / motivation**

Having the variable parts of the metrics makes it really difficult to aggregate the metrics. Seems that statsd python library does not support tags, but there are possible solutions by installing extensions:

https://stackoverflow.com/questions/49852654/sending-statsd-metrics-with-tags-from-python-client

**Related Issues**

<!-- Is there currently another issue associated with this? -->

"""
        Find all dags that were not updated by Dag Processor recently and mark them as inactive.
        In case one of DagProcessors is stopped (in case there are multiple of them
        for different dag folders), it's dags are never marked as inactive.
        Also remove dags from SerializedDag table.
        Executed on schedule only if [scheduler]standalone_dag_processor is True.
        """
        self.log.debug("Checking dags not parsed within last %s seconds.", self._dag_stale_not_seen_duration)
        limit_lpt = timezone.utcnow() - timedelta(seconds=self._dag_stale_not_seen_duration)
        stale_dags = (
            session.query(DagModel).filter(DagModel.is_active, DagModel.last_parsed_time < limit_lpt).all()
        )
        if not stale_dags:
            self.log.debug("Not stale dags found.")
            return
        self.log.info("Found (%d) stales dags not parsed after %s.", len(stale_dags), limit_lpt)
        for dag in stale_dags:
            dag.is_active = False
            SerializedDagModel.remove_dag(dag_id=dag.dag_id, session=session)
        session.flush()
    def _set_orphaned(self, dataset: DatasetModel) -> int:
        self.log.info("Orphaning unreferenced dataset '%s'", dataset.uri)
        dataset.is_orphaned = expression.true()
        return 1
    @provide_session
    def _orphan_unreferenced_datasets(self, session: Session = NEW_SESSION) -> None: