original_docstring: Set Prometheus scrape configuration for all targets.
docstring: Set Prometheus scrape configuration for all targets.
docstring_tokens: Set Prometheus scrape configuration for all targets .
code: def _set_jobs_to_new_downstream(self, event):
          """Set Prometheus scrape configuration for all targets."""
          if not self.unit.is_leader():
              return
  
          if self._has_upstream_relations():
              self.unit.status = BlockedStatus("upstream relations missing")
              return
  
          self.unit.status = MaintenanceStatus(
              "Providing scrape jobs and alert rules to new downstream"
          )
  
          self._update_downstream_relations([event.relation])
  
          self.unit.status = ActiveStatus()
code_tokens: def _set_jobs_to_new_downstream ( self , event ) : if not self . unit . is_leader ( ) : return if self . _has_upstream_relations ( ) : self . unit . status = BlockedStatus ( "upstream relations missing" ) return self . unit . status = MaintenanceStatus ( "Providing scrape jobs and alert rules to new downstream" ) self . _update_downstream_relations ( [ event . relation ] ) self . unit . status = ActiveStatus ( )
short_docstring: Set Prometheus scrape configuration for all targets.
short_docstring_tokens: Set Prometheus scrape configuration for all targets .
comment: """Set Prometheus scrape configuration for all targets."""