Skip to content

Commit

Permalink
feat(opentelemetry-exporter-otlp-http): fix otlp http exporter
Browse files Browse the repository at this point in the history
hold off on updating labels to attributes until the proto is updated
  • Loading branch information
pirgeo committed Oct 29, 2021
1 parent 10cecb9 commit e11d308
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { SpanAttributes, HrTime } from '@opentelemetry/api';
import { Labels, ValueType } from '@opentelemetry/api-metrics';
import { Attributes as Labels, ValueType } from '@opentelemetry/api-metrics';
import * as core from '@opentelemetry/core';
import {
AggregatorKind,
Expand Down Expand Up @@ -56,7 +56,7 @@ export function toAggregationTemporality(
}

/**
* Returns an DataPoint which can have integers or doublle values
* Returns an DataPoint which can have integers or double values
* @param metric
* @param startTime
*/
Expand All @@ -65,7 +65,7 @@ export function toDataPoint(
startTime: number
): opentelemetryProto.metrics.v1.DataPoint {
return {
labels: toCollectorLabels(metric.labels),
labels: toCollectorLabels(metric.attributes),
value: metric.aggregator.toPoint().value as number,
startTimeUnixNano: startTime,
timeUnixNano: core.hrTimeToNanoseconds(
Expand All @@ -88,7 +88,7 @@ export function toHistogramPoint(
timestamp: HrTime;
};
return {
labels: toCollectorLabels(metric.labels),
labels: toCollectorLabels(metric.attributes),
sum: value.sum,
count: value.count,
startTimeUnixNano: startTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('transformMetrics', () => {
);
});

it('should convert metric labels value to string', () => {
it('should convert metric attributes value to string', () => {
const metric = transform.toCollectorMetric(
{
descriptor: {
Expand All @@ -168,7 +168,7 @@ describe('transformMetrics', () => {
metricKind: 0,
valueType: 0,
},
labels: { foo: (1 as unknown) as string },
attributes: { foo: (1 as unknown) as string },
aggregator: new SumAggregator(),
resource: new Resource({}),
aggregationTemporality: 0,
Expand Down

0 comments on commit e11d308

Please sign in to comment.