Skip to content

Remove Istio telemetry #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ ci-build-images:
@./build/build-image.sh images/istio-galley istio-galley
@./build/build-image.sh images/istio-pilot istio-pilot
@./build/build-image.sh images/istio-proxy istio-proxy
@./build/build-image.sh images/istio-mixer istio-mixer

ci-push-images:
@./build/push-image.sh manager
Expand All @@ -173,7 +172,6 @@ ci-push-images:
@./build/push-image.sh istio-galley
@./build/push-image.sh istio-pilot
@./build/push-image.sh istio-proxy
@./build/push-image.sh istio-mixer


ci-build-cli:
Expand Down
7 changes: 0 additions & 7 deletions cli/cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,20 +338,13 @@ func getAPIMetrics(appName, apiName string) (*schema.APIMetrics, error) {
}

func appendNetworkMetrics(apiTable table.Table, apiMetrics *schema.APIMetrics) table.Table {
latency := "-"
if apiMetrics.NetworkStats.Latency != nil {
latency = fmt.Sprintf("%.9g", *apiMetrics.NetworkStats.Latency)
}

headers := []table.Header{
{Title: "avg latency"},
{Title: "2XX", Hidden: apiMetrics.NetworkStats.Code2XX == 0},
{Title: "4XX", Hidden: apiMetrics.NetworkStats.Code4XX == 0},
{Title: "5XX", Hidden: apiMetrics.NetworkStats.Code5XX == 0},
}

row := []interface{}{
latency,
apiMetrics.NetworkStats.Code2XX,
apiMetrics.NetworkStats.Code4XX,
apiMetrics.NetworkStats.Code5XX,
Expand Down
2 changes: 0 additions & 2 deletions cortex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ export CORTEX_IMAGE_ISTIO_CITADEL="${CORTEX_IMAGE_ISTIO_CITADEL:-cortexlabs/isti
export CORTEX_IMAGE_ISTIO_GALLEY="${CORTEX_IMAGE_ISTIO_GALLEY:-cortexlabs/istio-galley:$CORTEX_VERSION_STABLE}"
export CORTEX_IMAGE_ISTIO_PILOT="${CORTEX_IMAGE_ISTIO_PILOT:-cortexlabs/istio-pilot:$CORTEX_VERSION_STABLE}"
export CORTEX_IMAGE_ISTIO_PROXY="${CORTEX_IMAGE_ISTIO_PROXY:-cortexlabs/istio-proxy:$CORTEX_VERSION_STABLE}"
export CORTEX_IMAGE_ISTIO_MIXER="${CORTEX_IMAGE_ISTIO_MIXER:-cortexlabs/istio-mixer:$CORTEX_VERSION_STABLE}"

export CORTEX_ENABLE_TELEMETRY="${CORTEX_ENABLE_TELEMETRY:-""}"
export CORTEX_TELEMETRY_URL="${CORTEX_TELEMETRY_URL:-"https://telemetry.cortexlabs.dev"}"
Expand Down Expand Up @@ -205,7 +204,6 @@ function install_cortex() {
-e CORTEX_IMAGE_ISTIO_GALLEY=$CORTEX_IMAGE_ISTIO_GALLEY \
-e CORTEX_IMAGE_ISTIO_PILOT=$CORTEX_IMAGE_ISTIO_PILOT \
-e CORTEX_IMAGE_ISTIO_PROXY=$CORTEX_IMAGE_ISTIO_PROXY \
-e CORTEX_IMAGE_ISTIO_MIXER=$CORTEX_IMAGE_ISTIO_MIXER \
-e CORTEX_ENABLE_TELEMETRY=$CORTEX_ENABLE_TELEMETRY \
$CORTEX_IMAGE_MANAGER
}
Expand Down
2 changes: 0 additions & 2 deletions dev/registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function create_registry() {
aws ecr create-repository --repository-name=cortexlabs/istio-pilot --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/istio-galley --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/istio-proxy --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/istio-mixer --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/operator --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/tf-serve --region=$REGISTRY_REGION || true
aws ecr create-repository --repository-name=cortexlabs/tf-api --region=$REGISTRY_REGION || true
Expand Down Expand Up @@ -137,7 +136,6 @@ elif [ "$cmd" = "update" ]; then
build_and_push $ROOT/images/istio-pilot istio-pilot latest
build_and_push $ROOT/images/istio-galley istio-galley latest
build_and_push $ROOT/images/istio-proxy istio-proxy latest
build_and_push $ROOT/images/istio-mixer istio-mixer latest
fi

build_and_push $ROOT/images/tf-api tf-api latest
Expand Down
1 change: 0 additions & 1 deletion docs/cluster/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export CORTEX_IMAGE_CLUSTER_AUTOSCALER="cortexlabs/cluster-autoscaler:master"
export CORTEX_IMAGE_NVIDIA="cortexlabs/nvidia:master"
export CORTEX_IMAGE_METRICS_SERVER="cortexlabs/metrics-server:master"
export CORTEX_IMAGE_ISTIO_PROXY="cortexlabs/istio-proxy:master"
export CORTEX_IMAGE_ISTIO_MIXER="cortexlabs/istio-mixer:master"
export CORTEX_IMAGE_ISTIO_PILOT="cortexlabs/istio-pilot:master"
export CORTEX_IMAGE_ISTIO_CITADEL="cortexlabs/istio-citadel:master"
export CORTEX_IMAGE_ISTIO_GALLEY="cortexlabs/istio-galley:master"
Expand Down
1 change: 0 additions & 1 deletion docs/cluster/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export CORTEX_IMAGE_CLUSTER_AUTOSCALER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com
export CORTEX_IMAGE_NVIDIA="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/nvidia:latest"
export CORTEX_IMAGE_METRICS_SERVER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/metrics-server:latest"
export CORTEX_IMAGE_ISTIO_PROXY="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-proxy:latest"
export CORTEX_IMAGE_ISTIO_MIXER="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-mixer:latest"
export CORTEX_IMAGE_ISTIO_PILOT="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-pilot:latest"
export CORTEX_IMAGE_ISTIO_CITADEL="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-citadel:latest"
export CORTEX_IMAGE_ISTIO_GALLEY="XXXXXXXX.dkr.ecr.us-west-2.amazonaws.com/cortexlabs/istio-galley:latest"
Expand Down
1 change: 0 additions & 1 deletion images/istio-mixer/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions manager/install_cortex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ function setup_istio() {
echo -n "."

envsubst < manifests/istio-values.yaml | helm template istio-manifests/istio --values - --name istio --namespace istio-system | kubectl apply -f - >/dev/null
envsubst < manifests/istio-metrics.yaml | kubectl apply -f - >/dev/null

kubectl -n=istio-system create secret generic 'aws-credentials' \
--from-literal='AWS_ACCESS_KEY_ID'=$CORTEX_AWS_ACCESS_KEY_ID \
--from-literal='AWS_SECRET_ACCESS_KEY'=$CORTEX_AWS_SECRET_ACCESS_KEY \
-o yaml --dry-run | kubectl apply -f - >/dev/null
istio_patch="[
{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/env/-\", \"value\": {\"name\": \"AWS_ACCESS_KEY_ID\", \"valueFrom\": {\"secretKeyRef\": {\"name\": \"aws-credentials\", \"key\": \"AWS_ACCESS_KEY_ID\"}}}},\
{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/env/-\", \"value\": {\"name\": \"AWS_SECRET_ACCESS_KEY\", \"valueFrom\": {\"secretKeyRef\": {\"name\": \"aws-credentials\", \"key\": \"AWS_SECRET_ACCESS_KEY\"}}}},\
]"
kubectl patch deployment istio-telemetry -n istio-system --type='json' -p="$istio_patch" >/dev/null
}

function validate_cortex() {
Expand Down
54 changes: 0 additions & 54 deletions manager/manifests/istio-metrics.yaml

This file was deleted.

17 changes: 2 additions & 15 deletions manager/manifests/istio-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,11 @@ galley:
enabled: true

mixer:
image: $CORTEX_IMAGE_ISTIO_MIXER
enabled: false
policy:
enabled: false
telemetry:
enabled: true
replicaCount: 1
autoscaleMin: 1
autoscaleMax: 5
resources:
requests:
cpu: 1000m
memory: 1G
limits:
cpu: 4800m
memory: 4G
env:
AWS_REGION: $CORTEX_REGION
LOG_GROUP_NAME: $CORTEX_LOG_GROUP
enabled: false

pilot:
image: $CORTEX_IMAGE_ISTIO_PILOT
Expand Down
47 changes: 1 addition & 46 deletions pkg/operator/workloads/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ func getAPIMetricsFunc(ctx *context.Context, api *context.API, period int64, sta
}

func queryMetrics(ctx *context.Context, api *context.API, period int64, startTime *time.Time, endTime *time.Time) ([]*cloudwatch.MetricDataResult, error) {
networkDataQueries := getNetworkStatsDef(ctx.App.Name, api, period)
latencyMetrics := getLatencyMetricsDef(api.Path, period)
allMetrics := append(latencyMetrics, networkDataQueries...)
allMetrics := getNetworkStatsDef(ctx.App.Name, api, period)

if api.Tracker != nil {
if api.Tracker.ModelType == userconfig.ClassificationModelType {
Expand Down Expand Up @@ -246,49 +244,6 @@ func getAPIDimensions(appName string, api *context.API) []*cloudwatch.Dimension
}
}

func getLatencyMetricsDef(routeName string, period int64) []*cloudwatch.MetricDataQuery {
networkDataQueries := []*cloudwatch.MetricDataQuery{
{
Id: aws.String("latency"),
Label: aws.String("Latency"),
MetricStat: &cloudwatch.MetricStat{
Metric: &cloudwatch.Metric{
Namespace: aws.String(config.Cortex.LogGroup),
MetricName: aws.String("response-time.instance.cortex"),
Dimensions: []*cloudwatch.Dimension{
{
Name: aws.String("RequestPath"),
Value: aws.String(routeName),
},
},
},
Stat: aws.String("Average"),
Period: aws.Int64(period),
},
},
{
Id: aws.String("request_count"),
Label: aws.String("RequestCount"),
MetricStat: &cloudwatch.MetricStat{
Metric: &cloudwatch.Metric{
Namespace: aws.String(config.Cortex.LogGroup),
MetricName: aws.String("response-time.instance.cortex"),
Dimensions: []*cloudwatch.Dimension{
{
Name: aws.String("RequestPath"),
Value: aws.String(routeName),
},
},
},
Stat: aws.String("SampleCount"),
Period: aws.Int64(period),
},
},
}

return networkDataQueries
}

func getRegressionMetricDef(appName string, api *context.API, period int64) []*cloudwatch.MetricDataQuery {
metric := &cloudwatch.Metric{
Namespace: aws.String(config.Cortex.LogGroup),
Expand Down