Merge custom resources on detection#515
Conversation
|
|
||
| def merge_resources(r1, r2): | ||
| """Merge two resources to get a new resource. | ||
| def merge_resources(resource_list): |
There was a problem hiding this comment.
@c24t I'd like to hear about your opinion.
Shall we consider the signature of os.path.join? https://docs.python.org/2/library/os.path.html#os.path.join
There was a problem hiding this comment.
Part of the motivation for making the arg a list was to match the signature in java, but since *args in python is more idiomatic than varargs in java, maybe this is the better approach here, and I like this pattern as a user.
You think callers are more likely to have to make a list to call merge_resources than have to splat a list if we mimic os.path.join?
There was a problem hiding this comment.
I put up https://github.com/c24t/opencensus-python/pull/1/files#diff-21856523a57af46b9f02f815944713e3R89 to see what this would look like.
There was a problem hiding this comment.
I don't have strong opinion here, just putting another option and see which one you would prefer.
Please do what you think is better. Either way looks good to me :)
b0499e1 to
5634048
Compare
5634048 to
a31fdbb
Compare
This PR changes resource detection (
monitored_resource.get_instance) to include custom type and resource labels if available, and to include labels from multiple resources if we detect more than one known environment (e.g. kubernetes on AWS).Fixes #457 and #514.
cc @mayurkale22