Page MenuHomePhabricator

ReviseToneExperimentInteractionLogger should use Experiment#send()
Closed, ResolvedPublic

Description

We're seeing ~2.5K validation errors to mediawiki.product_metrics.contributors.experiments from past 6 hours.

Inspecting the errors in Logstash, we see

"experiment": {
    "enrolled": "growthexperiments-revise-tone",
    "assigned": "control",
    "subject_id": "<redacted>",
    "sampling_unit": "mw-user",
    "coordinator": "default",
    "stream_name": "product_metrics.web_base",
    "schema_id": "/analytics/product_metrics/web/base/2.0.0",
    "contextual_attributes": [
        "agent_client_platform",
        "agent_client_platform_family",
        "performer_is_logged_in",
        "performer_is_temp",
        "performer_pageview_id",
        "performer_active_browsing_session_token",
        "mediawiki_skin",
        "mediawiki_database"
    ]
},
"$schema": "/analytics/product_metrics/web/base/1.5.0"

The error is '.experiment.coordinator' should be equal to one of the allowed values because default is not a valid experiment.coordinator value for pre-2.0.0 schemas.

However, the issue goes beyond that because EventGate stops validating experiment after it encounters that issue, but there's a lot of stuff in there that shouldn't be.

Root cause

In ReviseToneExperimentInteractionLogger.php:

$experimentConfig = $experiment->getExperimentConfig();
...
$eventData = [
	'experiment' => $experimentConfig,
] + $interactionData;
$this->submitInteraction( RequestContext::getMain(), $action, $eventData );

This is because it wasn't possible to setStream(), but with T415277 it is now possible to use Experiment#send() with a custom stream in PHP.

Acceptance criteria

  • GrowthExperiments ReviseTone experiment instrumentation uses Experiment#send()
  • No more validation errors from mediawiki.product_metrics.contributors.experiments stream

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
mpopov triaged this task as High priority.Thu, Feb 5, 4:19 PM

Change #1237263 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] metrics(ReviseTone): Use Experiment::send to send metrics

https://gerrit.wikimedia.org/r/1237263

Change #1237851 had a related patch set uploaded (by Phuedx; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.14] metrics(ReviseTone): Use Experiment::send to send metrics

https://gerrit.wikimedia.org/r/1237851

Change #1237263 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] metrics(ReviseTone): Use Experiment::send to send metrics

https://gerrit.wikimedia.org/r/1237263

Change #1237851 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.14] metrics(ReviseTone): Use Experiment::send to send metrics

https://gerrit.wikimedia.org/r/1237851

Mentioned in SAL (#wikimedia-operations) [2026-02-09T09:21:03Z] <phuedx@deploy2002> Started scap sync-world: Backport for [[gerrit:1237851|metrics(ReviseTone): Use Experiment::send to send metrics (T416612)]], [[gerrit:1237852|metrics(ReviseTone): send consistent experiment exposure event (T416199)]]

Mentioned in SAL (#wikimedia-operations) [2026-02-09T09:25:05Z] <phuedx@deploy2002> phuedx: Backport for [[gerrit:1237851|metrics(ReviseTone): Use Experiment::send to send metrics (T416612)]], [[gerrit:1237852|metrics(ReviseTone): send consistent experiment exposure event (T416199)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-02-09T09:48:37Z] <phuedx@deploy2002> Finished scap sync-world: Backport for [[gerrit:1237851|metrics(ReviseTone): Use Experiment::send to send metrics (T416612)]], [[gerrit:1237852|metrics(ReviseTone): send consistent experiment exposure event (T416199)]] (duration: 27m 34s)

Etonkovidova subscribed.

Checked logstash - message: '.experiment.coordinator' should be equal to one of the allowed values stopped @timestamp: Feb 9, 2026 @ 09:48:18.536 - https://logstash.wikimedia.org/goto/9ebfd5b81fc74ab76f8f072712f82a14

Screenshot 2026-02-12 at 6.21.01 PM.png (346×2 px, 51 KB)