Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Add Resource API#193

Merged
mayurkale22 merged 6 commits intocensus-instrumentation:masterfrom
mayurkale22:resourceAPI
Nov 27, 2018
Merged

Add Resource API#193
mayurkale22 merged 6 commits intocensus-instrumentation:masterfrom
mayurkale22:resourceAPI

Conversation

@mayurkale22
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

LGTM overall

Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
@isaikevych
Copy link
Copy Markdown
Contributor

Please wait for Osvaldo`s review

Comment thread packages/opencensus-core/src/internal/string-utils.ts
Comment thread packages/opencensus-core/src/resource/resource.ts
* <p>OC_RESOURCE_TYPE: A string that describes the type of the resource
* prefixed by a domain namespace, e.g. “kubernetes.io/container”.
*/
private static parseResourceType(rawEnvType: string): string {
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.

Could you please move private methods to top for more readability?

Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts
Copy link
Copy Markdown
Contributor

@isaikevych isaikevych left a comment

Choose a reason for hiding this comment

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

Please add documentation

* @returns {Resource}
*/
static createFromEnvironmentVariables(): Resource {
return new Resource(Resource.ENV_TYPE, Resource.ENV_LABEL_MAP);
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.

Why we need this? can we move it to constructor?

Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts
Comment thread packages/opencensus-core/src/resource/resource.ts
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts Outdated
Comment thread packages/opencensus-core/test/test-resource.ts Outdated
Comment thread packages/opencensus-core/src/resource/resource.ts
Comment thread packages/opencensus-core/src/resource/types.ts Outdated

import * as assert from 'assert';

process.env.OC_RESOURCE_TYPE = 'k8s.io/container';
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.

My guess that its necessary just for first describe, if so - please move to place of usage

Copy link
Copy Markdown
Contributor

@isaikevych isaikevych left a comment

Choose a reason for hiding this comment

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

Thank you

@mayurkale22
Copy link
Copy Markdown
Member Author

@isaikevych Thank you for the reviews.

@mayurkale22 mayurkale22 merged commit 5fe3b38 into census-instrumentation:master Nov 27, 2018
@mayurkale22 mayurkale22 deleted the resourceAPI branch November 27, 2018 01:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants