Problem/Motivation

Modernize the prometheus_exporter module to use Symfony container autowiring and autoconfiguration, reducing boilerplate in service definitions and improving IDE support.

Steps to reproduce

Proposed resolution

  • Add _defaults with autowire: true and autoconfigure: true to services.yml files
  • Remove explicit arguments from service definitions (autowiring handles injection)
  • Remove event_subscriber tags (autoconfigure adds them automatically)
  • Add class-based service aliases (e.g., Drupal\prometheus_exporter\MetricsCollectorManager: '@prometheus_exporter.metrics_collector_manager')
  • Replace string service IDs with ::class constants in $container->get() calls
  • Refactor classes to use constructor property promotion, typed properties, and return types on create() methods
  • Use EntityTypeManagerInterface instead of storing entity storage directly

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kim.pepper created an issue. See original summary.

  • kim.pepper committed 9cdcb215 on 2.x
    task: #3591456 Modernize services to use Symfony autowiring,...
kim.pepper’s picture

Status: Active » Fixed

Committed to 2.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.