You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The attributes (labels) of collected Metrics in my application utilizing opentelemetry-collector are not being exported.
I am making a simple node.js request counter:
import { DiagConsoleLogger, DiagLogLevel, diag } from '@opentelemetry/api';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-grpc';
import { MeterProvider } from '@opentelemetry/sdk-metrics-base';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
// Optional and only needed to see the internal diagnostic logging (during development)
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const exporter = new OTLPMetricExporter();
const meter = new MeterProvider({
exporter,
interval: 10 * 1000,
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'my-distinguishing-metric-service',
}),
}).getMeter('example-exporter-collector');
const requestCounter = meter.createCounter('requests', {
description: 'Example of a Counter',
});
const userId = 'myUserId';
const statusCode = 500;
const labels = { userId, statusCode };
setInterval(() => {
// @ts-ignore
requestCounter.add(1, labels);
}, 1000);
Steps to reproduce
I can verify that the metric itself is exported in both logging and OTLP exporters. However, the labels are not exported via OTLP and are also missing in the logging exporter with logLevel: debug.
Log from logging exporter:
I have tried removing the batch processor, no change.
I haven't tried other SDKs i.e. python, Go, ... however it's seems it's likely caused by a (mis)configuration in opentelemetry-collector or perhaps an unsupported feature, however. I haven't found this documented anywhere.
This issue is happening because the JS otlp exporters are using an outdated version of protobufs. The JS otlp exporters are still sending over the old labels over otlp instead of the newer attributes but there is an open issue to get the protobuf version updated.
Since there is an open issue about this in the otel-js repo, we can close this issue here.
Describe the bug
The attributes (labels) of collected Metrics in my application utilizing
opentelemetry-collector
are not being exported.I am making a simple node.js request counter:
Steps to reproduce
I can verify that the metric itself is exported in both logging and OTLP exporters. However, the labels are not exported via OTLP and are also missing in the logging exporter with
logLevel: debug
.Log from logging exporter:
Log from
DiagConsoleLogger()
in the node app:What did you expect to see?
I expected the attributes to be displayed in logging and OTLP exporters.
What did you see instead?
I only see the metric itself without the attributes.
What config did you use?
otel-config.yaml
:Environment
otel/opentelemetry-collector:0.49.0
docker image.package.json
excerpt:Additional context
opentelemetry-collector
or perhaps an unsupported feature, however. I haven't found this documented anywhere.The text was updated successfully, but these errors were encountered: