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 Nov 4, 2021
1 parent 3b76c24 commit 4d65142
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 @@ -54,7 +54,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 @@ -63,7 +63,7 @@ export function toDataPoint(
startTime: number
): otlpTypes.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 @@ -86,7 +86,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 4d65142

Please sign in to comment.