Why is My Evidently Launch Failing?

0

I'm trying to call the CreateLaunch API in the CloudWatch Evidently service to launch new features. I'm using the AWS SDK v3 for Javascript. However, I'm getting the following error:

ValidationException-Launch groups name in steps not present in groups

Here are the parameters that I'm passing into the CreateLaunch Command:

2023-09-01T15:56:51.511Z	6e811110-f335-4d34-a37b-8703807c268f	INFO	Create Launch Parameters: {
    "project": "****", //removed for security purposes
    "name": "test-launch",
    "groups": [
        {
            "name": "test-launch-test-feature-true",
            "feature": "test-feature",
            "variation": "true"
        },
        {
            "name": "test-launch-test-feature-false",
            "feature": "test-feature",
            "variation": "false"
        }
    ],
    "scheduledSplitsConfig": {
        "steps": [
            {
                "startTime": "2023-09-01T14:30:28.208Z",
                "groupWeights": {
                    "true": 1,
                    "false": 0
                },
                "segmentOverrides": [
                    {
                        "segment": "agent_feedback",
                        "evaluationOrder": 0,
                        "weights": {
                            "true": 0,
                            "false": 1
                        }
                    }
                ]
            }
        ]
    }
}

I've looked through the SDK v3 documentation here: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/evidently/command/CreateLaunchCommand/ and the API reference here: https://docs.aws.amazon.com/cloudwatchevidently/latest/APIReference/API_CreateLaunch.html#API_CreateLaunch_Examples

I can't figure out what's wrong with the parameters I'm passing in. Any guidance is appreciated.

kenchen
已提问 9 个月前221 查看次数
1 回答
0

Figured out the answer on my own, but the examples in the documentation need to be modified so others don't make the same mistake.

The "feature variation" keys under the groupWeights and weights (under segmentOverride) fields need to match with the group names specified in groups.

The updated should be

{
    "project": "****", //removed for security purposes
    "name": "test-launch",
    "groups": [
        {
            "name": "test-launch-test-feature-true",
            "feature": "test-feature",
            "variation": "true"
        },
        {
            "name": "test-launch-test-feature-false",
            "feature": "test-feature",
            "variation": "false"
        }
    ],
    "scheduledSplitsConfig": {
        "steps": [
            {
                "startTime": "2023-09-01T14:30:28.208Z",
                "groupWeights": {
                    "test-launch-test-feature-true": 1, <- must match group name
                    "test-launch-test-feature-false": 0 <- must match group name
                },
                "segmentOverrides": [
                    {
                        "segment": "agent_feedback",
                        "evaluationOrder": 0,
                        "weights": {
                            "test-launch-test-feature-true": 0, <- must match group name
                            "test-launch-test-feature-false": 1 <- must match group name
                        }
                    }
                ]
            }
        ]
    }
}
kenchen
已回答 9 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则