Skip to content

Commit

Permalink
fix(exporter-collector-grpc): incorrect default URL after 0.20.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoluiz committed Jun 8, 2021
1 parent 3d98420 commit 99bffbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/opentelemetry-exporter-collector-grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const { BasicTracerProvider, SimpleSpanProcessor } = require('@opentelemetry/tra
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector-grpc');

const collectorOptions = {
// url is optional and can be omitted - default is localhost:4317
// url is optional and can be omitted - default is grpc://localhost:4317
url: '<collector-hostname>:<port>',
};

Expand All @@ -51,7 +51,7 @@ const { BasicTracerProvider, SimpleSpanProcessor } = require('@opentelemetry/tra
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector-grpc');

const collectorOptions = {
// url is optional and can be omitted - default is localhost:4317
// url is optional and can be omitted - default is grpc://localhost:4317
url: '<collector-hostname>:<port>',
credentials: grpc.credentials.createSsl(),
};
Expand Down Expand Up @@ -91,7 +91,7 @@ const metadata = new grpc.Metadata();
metadata.set('k', 'v');

const collectorOptions = {
// url is optional and can be omitted - default is localhost:4317
// url is optional and can be omitted - default is grpc://localhost:4317
url: '<collector-hostname>:<port>',
metadata, // // an optional grpc.Metadata object to be sent with each request
};
Expand All @@ -116,7 +116,7 @@ The CollectorTraceExporter in Node expects the URL to only be the hostname. It w
const { MeterProvider } = require('@opentelemetry/metrics');
const { CollectorMetricExporter } = require('@opentelemetry/exporter-collector-grpc');
const collectorOptions = {
// url is optional and can be omitted - default is localhost:4317
// url is optional and can be omitted - default is grpc://localhost:4317
url: '<collector-hostname>:<port>',
};
const exporter = new CollectorMetricExporter(collectorOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CollectorExporterNodeBase } from './CollectorExporterNodeBase';
import { getEnv } from '@opentelemetry/core';
import { validateAndNormalizeUrl } from './util';

const DEFAULT_COLLECTOR_URL = 'localhost:4317';
const DEFAULT_COLLECTOR_URL = 'grpc://localhost:4317';

/**
* Collector Metric Exporter for Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CollectorExporterConfigNode, ServiceClientType } from './types';
import { getEnv } from '@opentelemetry/core';
import { validateAndNormalizeUrl } from './util';

const DEFAULT_COLLECTOR_URL = 'localhost:4317';
const DEFAULT_COLLECTOR_URL = 'grpc://localhost:4317';

/**
* Collector Trace Exporter for Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('CollectorTraceExporter - node (getDefaultUrl)', () => {
it('should default to localhost', done => {
const collectorExporter = new CollectorTraceExporter({});
setTimeout(() => {
assert.strictEqual(collectorExporter['url'], 'localhost:4317');
assert.strictEqual(collectorExporter['url'], 'grpc://localhost:4317');
done();
});
});
Expand Down

0 comments on commit 99bffbe

Please sign in to comment.