@opentelemetry/exporter-collector-grpc not connecting after 0.20.0 upgrade
See original GitHub issuePlease answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
- Collector:
otel/opentelemetry-collector-contrib:0.27.0 - SDK: 0.20.0
What version of Node are you using?
v12.20.0
Please provide the code you used to setup the OpenTelemetry SDK
import { SimpleSpanProcessor } from '@opentelemetry/tracing';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { CollectorTraceExporter } from '@opentelemetry/exporter-collector-grpc';
import { NodeTracerProvider } from '@opentelemetry/node';
export class OpenTelemetry {
static register({ serviceName, collectorUrl, instrumentations }) {
const provider = new NodeTracerProvider();
if (collectorUrl != false && collectorUrl != undefined) {
const collectorExporter = new CollectorTraceExporter({
serviceName: serviceName,
url: collectorUrl,
});
provider.addSpanProcessor(new SimpleSpanProcessor(collectorExporter));
}
provider.register();
registerInstrumentations({
tracerProvider: provider,
instrumentations,
});
['SIGINT', 'SIGTERM'].forEach((signal) => {
process.on(signal, () => provider.shutdown().catch(console.error));
});
}
}
What did you do?
Call OpenTelemetry.register({ serviceName: 'service', url: 'localhost:4317', instrumentations: [] ); on the top of src/index.js.
What did you expect to see?
My OpenTelemetry collector is running in kube (port-forwarded). I was expecting the NodeJS service to connect to it, returning a Handling connection for 4317 and registering the trace at our internal Jaeger (could be other tracing service).
What did you see instead?
No Handling connection for 4317 and no trace available
Additional context
I ran the code above with both 0.20.0 and 0.19.0 versions. It only give the expected behaviour on version 0.19.0.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
OTLP exporter endpoint config should require scheme #2539
Running collector version 0.20.0 configured to use the OTLP exporter as follows: exporters: otlp: endpoint: https://my-otlp-endpoint:4317/ I ...
Read more >@opentelemetry/exporter-collector-grpc - npm
The CollectorTraceExporter in Node expects the URL to only be the hostname. It will not work with /v1/metrics . All options that work...
Read more >@opentelemetry/exporter-trace-otlp-proto - Package Manager
OpenTelemetry Collector Exporter allows user to send collected traces to the OpenTelemetry Collector using protobuf over HTTP.
Read more >OpenTelemetry Operator Helm Chart - Artifact Hub
The following example configuration deploys the Collector as Deployment resource. The receiver is Jaeger receiver and the exporter is logging exporter. $ ...
Read more >OTLP Exporter Configuration - OpenTelemetry
The following environment variables let you configure an OTLP/gRPC or OTLP/HTTP endpoint for your traces, metrics, and logs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I managed to set service name like this:
There are notes in readmes of opentelemetry-exporter-* packages, which says service name is now not the part of exporter config. So looks like it was removed …
https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-exporter-collector
Well, updating the URL to
grpc://...definitely worked in terms of connection. But, it still didn’t register any traces 😞