Evidently-sushi - Sample for creating a CloudWatch Evidently project

evidently-sushi

This is a sample for creating a CloudWatch Evidently project.

Preparation

  • Install AWS CLI
    • v1: 1.22.16 or higher
    • v2: 2.4.3 or higher

Deploy

via CloudFormation

sh ./cfn/10-evidently.sh 'deploy'

Start Launch

aws evidently start-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'

Simple check with AWS CLI

Project

aws evidently get-project \
--project 'FoodProject'

Feature

aws evidently get-feature \
--project 'FoodProject' \
--feature 'SushiFeature'

Launch

aws evidently get-launch \
--project 'FoodProject' \
--launch 'SushiLaunch'

Evaluate Feature

Run the "evaluate-feature" API 10 times with different EntityIDs.

for i in `seq 10`; do
  aws evidently evaluate-feature \
  --project 'FoodProject' \
  --feature 'SushiFeature' \
  --entity-id "$(date -u +'%s')-${i}" \
  --query 'value.stringValue' \
  --output text
  sleep 1
done

Then you will get the following output.

engawa
engawa
uni
tamago
maguro
maguro
tamago
uni
uni
maguro

If you specify the EntityID set in EntityOverrides, a fixed value will be returned regardless of the percentage of traffic.

for i in `seq 10`; do
  aws evidently evaluate-feature \
  --project 'FoodProject' \
  --feature 'SushiFeature' \
  --entity-id 'shari' \
  --query 'value.stringValue' \
  --output text
done

The output will look like the following

no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta
no neta

Start proxy server at local

Start a proxy server in your local environment to run CloudWatch Evidently's EvaluateFeature API.

cd app && go run .

You can get a summary of the Evidently::EvaluateFeature results as a Response by making a request to http://localhost:8080/features/evaluate.

curl 'http://localhost:8080/features/evaluate' | jq .
{
  "entityId": "16c83217c7058878",
  "name": "SushiFeature",
  "reason": "LAUNCH_RULE_MATCH",
  "value": "uni"
}

You can use a fixed EntityID by specifying a specific value for the query parameter entity_id.

curl 'http://localhost:8080/features/evaluate?entity_id=shari' | jq .
{
  "entityId": "shari",
  "name": "SushiFeature",
  "reason": "ENTITY_OVERRIDES_MATCH",
  "value": "no neta"
}
Similar Resources

sample apps docker with postgres-node.js-golang

Belajar Docker untuk Pemula - Membuat TODO App TODO app ini adalah contoh app untuk mendemokan proses membuat aplikasi dengan Docker, terdiri dari: Fr

Jan 2, 2022

Golang Rest Api Sample

Golang Rest Api Sample

Golang Rest Api Sample Şimdi localhost’umuzda HTTP requestleri ile çalışan basit

Nov 9, 2022

Walker's alias method is an efficient algorithm to sample from a discrete probability distribution.

walker-alias Walker's alias method is an efficient algorithm to sample from a discrete probability distribution. This means given an arbitrary probabi

Jun 14, 2022

Sample Hello World Pulumi Program for Azure

Overview This is a standard hello world style Pulumi program for Azure straight from the Pulumi docs. This is a sample repo used to test Pulumi's Auto

Jan 13, 2022

Knative Sample Controller

Knative Sample Controller Knative sample-controller defines a few simple resources that are validated by webhook and managed by a controller to demons

Jan 21, 2022

A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore

bookstore-sample-controller A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore. A resource cre

Jan 20, 2022

This sample shows how to host multiple Azure functions in Golang.

This sample shows how to host multiple Azure functions in Golang.

azure-function-custom-handler-with-golang This sample shows how to host multiple Azure functions in Golang. To learn more about this sample please che

Dec 26, 2022

Go-http-server-docker - Simple sample server using docker and go

go-http-server-docker Simple sample webserver using docker and go.

Jan 8, 2022

Nrod-go - Sample application to process Train Movements messages from the Network Rail Open Data feed

NROD Train Movements Processor Sample application to process Train Movements mes

Dec 3, 2022
EdgeDB-Golang-Docker-Sample - The sample of connection between EdgeDB Server and Go Echo API Server

EdgeDB Golang Docker Sample 『Go + Docker Composeを使ってEdgeDBを動かしてみた』のサンプルコードです。 使い

Nov 2, 2022
Sample Driver that provides reference implementation for Container Object Storage Interface (COSI) API

cosi-driver-minio Sample Driver that provides reference implementation for Container Object Storage Interface (COSI) API Community, discussion, contri

Oct 10, 2022
Sample multi docker compose environment setup

Instructions This is a demonstration of a Multi Docker Compose. The purpose of this repositoy is ongoing research on "Docker compose" architecture des

Oct 21, 2022
Kubernetes APIServer Aggregation Sample

apiserver-aggregation-sample Kubernetes APIServer Aggregation Sample Create an apiserver sample Initialize the Project apiserver-boot init repo --doma

Nov 23, 2021
Sample application accessing kubernetes secrets

Kubernetes secrets API example This git repo illustrates a small application which can access kubernetes secrets. Build small application To test the

Dec 19, 2021
This is a sample application of golang's web framework gin and orm ent.

Gin Ent Sample This is a sample application of golang's web framework gin and orm ent. Components Web Framework: Gin ORM: ent SQL Migration tool: goos

Dec 5, 2021
This repo houses some Golang introductory files, sample codes and implementations

This repo houses some Golang introductory files, sample codes and implementations. I will be updating it as I keep getting a hang of the language.

Aug 27, 2022
A kubernetes operator sample generated by kubebuilder , which run cmd in pod on specified time

init kubebuilder init --domain github.com --repo github.com/tonyshanc/sample-operator-v2 kubebuilder create api --group sample --version v1 --kind At

Jan 25, 2022
Develop sample controller step by step

Develop sample controller step by step

Jul 21, 2022
A sample for okteto pipelines with terraform

Okteto Pipeline with Terraform (PubSub) This sample covers a producer/consumer a

Dec 23, 2021