add support for other projects for external metrics#212
Conversation
| func (t *Translator) GetExternalMetricProject(metricSelector labels.Selector) (string, error) { | ||
| requirements, _ := metricSelector.Requirements() | ||
| for _, req := range requirements { | ||
| if req.Key() == "resource.labels.project_id" { |
There was a problem hiding this comment.
Please make sure that req.Operator() is selection.Equals (or selection.DoubleEquals), otherwise an error should be returned.
|
Thanks for contribution! I have a small comment, but LGTM otherwise. Please update the documentation to reflect this. |
|
@kawych Added documentation. Let me know if it needs anything else, whether stylistic or content. I followed the existing examples docs. |
|
Thanks. Can you file a separate PR for the documentation? Sorry for not being clear with that, I want to submit it only after we do a next release of the adapter. |
8237a27 to
7006cc9
Compare
|
LGTM |
|
I've noticed that the last release is from 18 June (custom-metrics-stackdriver-adapter v0.8.0). Are there any plans to roll out a new release soon? I could really use this feature. |
|
I've started a release of the new version. Should be available in several days. |
|
Any update on the release? Thanks! |
Addresses #205
I tried to keep my changes as minimal as possible as I don't really have the bandwidth or expertise to do a large refactor. This has been tested in my environment to maintain existing functionality, as well as access to metrics in other projects. Adding scope was necessary to allow a service account to work, rather than GCE creds.
I would be happy to contribute documentation if this PR's code is deemed mergable.
Example spec:
Note: Access to other projects requires running the stackdriver adapter with a service account (recommended), or adding permissions to the default GCE creds (not advised).