Cron sends incorrect environment

Created on 18 September 2024, 8 months ago

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

πŸ› Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024