Skip to content

Add Stackdriver metrics exporter support for activator and autoscaler - #2337

Merged
knative-prow-robot merged 22 commits into
knative:masterfrom
akyyy:stackdriver-1026
Nov 6, 2018
Merged

knative-prow-robot merged 22 commits into
knative:masterfrom
akyyy:stackdriver-1026

Conversation

@akyyy

@akyyy akyyy commented Oct 26, 2018

Copy link
Copy Markdown
Contributor

Fixes #2019

Proposed Changes

  • Use UpdateExporterFromConfigMap in pkg repo to update the metrics exporter dynamically.

@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 26, 2018
Comment thread cmd/autoscaler/main.go
return ctl.Run(controllerThreads, stopCh)
})

// Setup the metrics to flow to Prometheus.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this started implicitly by importing "metrics" above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akyyy

akyyy commented Oct 29, 2018

Copy link
Copy Markdown
Contributor Author

Comment thread cmd/activator/main.go Resolved
Comment thread config/config-observability.yaml Outdated
# Note: Using stackdriver would incur charges for knative-serving system metrics
# before we have own resource types.
metrics.stackdriver-project-id: "<your stackdriver project id>"

No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you trim the space here?

Comment thread config/config-observability.yaml Outdated
# To export metrics to stackdriver, you need to have a valid stackdriver project ID.
# Note: Using stackdriver would incur charges for knative-serving system metrics
# before we have own resource types.
metrics.stackdriver-project-id: "<your stackdriver project id>"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd comment this if you are putting in a bogus value.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use this to default this when the backend-destination is "stackdriver", but stackdriver-project-id is omitted?

This is going to be the right answer 99.9% of the time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. We could actually skip this field if it's in GKE. I sent knative/pkg#147 for review.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we comment this line out as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll polish this pr after knative/pkg#147 is checked in.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in!

@tcnghia tcnghia left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 31, 2018
@akyyy

akyyy commented Oct 31, 2018

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread test/e2e-tests.sh
-v -tags=e2e -count=1 -timeout=20m \
./test/conformance ./test/e2e \
${options} || fail_test
go_test_e2e -timeout=20m ./test/conformance ./test/e2e || fail_test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this change is relevant to your PR?

@akyyy akyyy Oct 31, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This came from a merge with head.

Comment thread config/config-observability.yaml Resolved
@akyyy

akyyy commented Oct 31, 2018

Copy link
Copy Markdown
Contributor Author

/retest

@akyyy

akyyy commented Nov 5, 2018

Copy link
Copy Markdown
Contributor Author

Gentle ping. @mattmoor @mdemirhan Could you please look at this? Thanks!

Comment thread pkg/metrics/config.go Outdated

const (
ObservabilityConfigName = "config-observability"
metricsDomain = "serving.knative.dev"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use GroupName from pkg/apis/serving?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mattmoor

mattmoor commented Nov 5, 2018

Copy link
Copy Markdown
Contributor

@akyyy looks like you need a rebase. My comments are largely addressed, I'll defer to @mdemirhan

@knative-metrics-robot

Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/autoscaler/main.go 4.4% 4.8% 0.4
pkg/metrics/config.go Do not exist 0.0%

@mdemirhan

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 6, 2018
@knative-prow-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akyyy, mdemirhan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 6, 2018
@akyyy

akyyy commented Nov 6, 2018

Copy link
Copy Markdown
Contributor Author

/retest

@knative-prow-robot
knative-prow-robot merged commit 4cda03d into knative:master Nov 6, 2018
@akyyy
akyyy deleted the stackdriver-1026 branch November 6, 2018 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants