Problem/Motivation

I run Drupal in Docker containers and inject SENTRY_ENVIRONMENT to distinguish between staging and production environments. I also have cron monitoring set up, but Drupal always reports the environment as production.

This is because the environment and release arguments are the wrong way round:

  $checkIn = new CheckIn($slug, CheckInStatus::inProgress(), NULL, $options->getEnvironment(), $options->getRelease(), \Drupal::time()->getCurrentMicroTime() - \Drupal::time()->getRequestMicroTime());

vs

    public function __construct(
        string $monitorSlug,
        CheckInStatus $status,
        ?string $id = null,
        ?string $release = null,
        ?string $environment = null,
        $duration = null,
        ?MonitorConfig $monitorConfig = null
    ) {

$options->getRelease() is null in my case, which falls back in the Sentry code to production.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork raven-3475204

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

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

  • mfb committed 2d87396c on 6.x authored by longwave
    Issue #3475204 by longwave: Fix argument order
    

  • mfb committed e623d252 on 5.x authored by longwave
    Issue #3475204 by longwave: Fix argument order
    

  • mfb committed e8790733 on 4.x authored by longwave
    Issue #3475204 by longwave: Fix argument order
    

  • mfb committed 8d086f55 on 3.x authored by longwave
    Issue #3475204 by longwave: Fix argument order
    
mfb’s picture

Status: Needs review » Fixed

oof :( Good catch, thanks!

mfb’s picture

Status: Fixed » Needs review
mfb’s picture

Status: Needs review » Fixed

Oops

Status: Fixed » Closed (fixed)

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