commit | de093a5e6bd18f62d5f241182cdf9bfd9e8307b5 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Tue Oct 19 15:22:39 2021 -0400 |
committer | Jonathan Amsterdam <jba@google.com> | Wed Oct 20 11:07:15 2021 +0000 |
tree | 4e2ca9a7817687ce2d9fee190ea57b5422032de3 | |
parent | c842fd0e8e143df6dcb21aefe959148cadc2e79b [diff] |
internal/config: get instance ID from metadata If the instance ID is not available from an environment variable, query the GCE metadata for it. This is necessary for Cloud Run. Its instance ID isn't available from an environment variable as App Engine's is, and without something to distinguish instances, metrics from multiple instances look the same and cause the StackDriver error "One or more points were written more frequently than the maximum sampling period configured for the metric." Also, log the monitored resource we use for metrics to aid in debugging. Change-Id: I477644572348bc72440c424ba84c2fc378c3fe35 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/357037 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Pkg.go.dev is a website for discovering and evaluating Go packages and modules.
You can check it out at https://pkg.go.dev.
If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.
For answers to frequently asked questions, see go.dev/about.
You can also chat with us on the #pkgsite Slack channel on the Gophers Slack.
We would love your help!
Our canonical Git repository is located at go.googlesource.com/pkgsite. There is a mirror of the repository at github.com/golang/pkgsite.
To contribute, please read our contributing guide.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.