Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Instrumentation Statsbeat #802

Merged
merged 4 commits into from
Aug 5, 2021

Conversation

hectorhdzg
Copy link
Member

No description provided.

AutoCollection/Statsbeat.ts Outdated Show resolved Hide resolved
@@ -153,6 +153,18 @@ class fakeHttpsServer extends events.EventEmitter {
}

describe("EndToEnd", () => {
var originalEnv = {};

before(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

E2E tests here rely on some fakeHttpServer serving all requests, now that Azure VM request is in place is making these tests unreliable, we need to refactor this code and use nock to handle all SDK HTTP requests correctly, created a task to take care of that in different PR

"rpid": this._resourceIdentifier,
}, commonProperties);
this._statbeatMetrics.push({ name: Constants.StatsbeatCounter.ATTACH, value: 1, properties: attachProperties });
this._statbeatMetrics.push({ name: Constants.StatsbeatCounter.INSTRUMENTATION, value: 1, properties: instrumentationProperties });
Copy link

Choose a reason for hiding this comment

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

I don't think it's confirmed yet to create a new instrumentation type.. we need to reconsider customDimentions for this. can you provide the payload for it? same as feature?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep same as feature but with instrumentation property instead, let me know if we need to update the properties here

Copy link

Choose a reason for hiding this comment

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

think about it more, we might not need to create a new metric for instrumentation.. we can reuse the feature metric.. they're identical. maybe just rename the "feature" to 'encodedLong' to support both feature and instrumentation and then add a flag to indicate type of encodedLong.

Copy link

Choose a reason for hiding this comment

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

we need to talk though.


export enum StatsbeatFeatureType {
Features,
Copy link

Choose a reason for hiding this comment

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

please use singular for all types.

@@ -245,13 +246,14 @@ describe("AutoCollection/Statsbeat", () => {
setTimeout(() => {
let envelope = spy.args[0][0][1];
let baseData: Contracts.MetricData = envelope.data.baseData;
assert.equal(baseData.metrics[0].name, "Instrumentation");
assert.equal(baseData.metrics[0].name, "Feature");
Copy link

Choose a reason for hiding this comment

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

all the properties in the custom dimensions are using lower case. please be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the metric name, must be fist letter upper case, please confirm

Copy link

Choose a reason for hiding this comment

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

oops, sorry miss read that. correct.

}

export enum StatsbeatFeatureType {
Copy link

Choose a reason for hiding this comment

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

FeatureStatsbeatType?

Copy link
Member Author

Choose a reason for hiding this comment

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

All types and enums in this file start with Statsbeat word to quickly find them

AutoCollection/Statsbeat.ts Outdated Show resolved Hide resolved
AutoCollection/Statsbeat.ts Outdated Show resolved Hide resolved
AutoCollection/Statsbeat.ts Outdated Show resolved Hide resolved
Copy link

@heyams heyams left a comment

Choose a reason for hiding this comment

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

👍

@hectorhdzg hectorhdzg merged commit 647ba50 into develop Aug 5, 2021
@hectorhdzg hectorhdzg deleted the hectorh/instrumentationstatsbeat branch September 16, 2021 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants