Skip to content

Commit e078711

Browse files
authored
[Azure Monitor-Opentelemetry] Fix Statsbeat Feature Enum to Match Spec (Azure#27613)
### Packages impacted by this PR @azure/monitor-opentelemetry ### Describe the problem that is addressed by this PR Statsbeat feature enum should use 0 to indicate feature statsbeat and 1 to indicate instrumentation. They were erroneously set to strings. ### Checklists - [x] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [x] Added a changelog (if necessary)
1 parent 54c6760 commit e078711

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

sdk/monitor/monitor-opentelemetry-exporter/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Release History
22

3+
## 1.0.0-beta.18 ()
4+
5+
### Features Added
6+
7+
### Breaking Changes
8+
9+
### Bugs Fixed
10+
11+
- Fix Feature and Instrumentation Statsbeat type value.
12+
13+
### Other Changes
14+
315
## 1.0.0-beta.17 (2023-10-09)
416

517
### Features Added

sdk/monitor/monitor-opentelemetry-exporter/src/export/statsbeat/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,6 @@ export interface VirtualMachineInfo {
125125
}
126126

127127
export enum StatsbeatFeatureType {
128-
FEATURE = "Feature",
129-
INSTRUMENTATION = "Instrumentation",
128+
FEATURE = 0,
129+
INSTRUMENTATION = 1,
130130
}

sdk/monitor/monitor-opentelemetry-exporter/test/internal/statsbeat.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ describe("#AzureMonitorStatsbeatExporter", () => {
368368
assert.strictEqual(metrics.length, 2, "Metrics count");
369369
assert.strictEqual(metrics[0].descriptor.name, StatsbeatCounter.FEATURE);
370370
assert.strictEqual(metrics[1].descriptor.name, StatsbeatCounter.ATTACH);
371+
// Instrumentation statsbeat
372+
assert.strictEqual(metrics[0].dataPoints[0].attributes.type, 1);
373+
// Feature statsbeat
374+
assert.strictEqual(metrics[0].dataPoints[1].attributes.type, 0);
371375

372376
// Clean up env variables
373377
delete process.env.STATSBEAT_INSTRUMENTATIONS;

0 commit comments

Comments
 (0)