Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Naseem committed Jan 14, 2020
1 parent 7b44d9e commit 462a762
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 20 deletions.
17 changes: 3 additions & 14 deletions examples/basic-tracer-node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ registry.addSpanProcessor(new SimpleSpanProcessor(exporter));

// Initialize the OpenTelemetry APIs to use the BasicTracerRegistry bindings
opentelemetry.initGlobalTracerRegistry(registry);
const tracer = opentelemetry.getTracer('example-basic-tracer-node')
const tracer = opentelemetry.getTracer('example-basic-tracer-node');

// Create a span. A span must be closed.
<<<<<<< HEAD
const parentSpan = opentelemetry.getTracer().startSpan('main');
const parentSpan = tracer.startSpan('main');
for (let i = 0; i < 10; i += 1) {
doWork(parentSpan);
=======
const span = tracer.startSpan('main');
for (let i = 0; i < 10; i++) {
doWork(span);
>>>>>>> master
}
// Be sure to end the span.
parentSpan.end();
Expand All @@ -51,13 +45,8 @@ exporter.shutdown();
function doWork(parent) {
// Start another span. In this example, the main method already started a
// span, so that'll be the parent span, and this will be a child span.
<<<<<<< HEAD
const span = opentelemetry.getTracer().startSpan('doWork', {
parent,
=======
const span = tracer.startSpan('doWork', {
parent: parent
>>>>>>> master
parent,
});

// simulate some random work.
Expand Down
1 change: 1 addition & 0 deletions examples/dns/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const tracer = require('./tracer')('example-dns');
// eslint-disable-next-line import/order
const dns = require('dns').promises;

/** A function which makes a dns lookup and handles response. */
Expand Down
11 changes: 11 additions & 0 deletions examples/grpc/helloworld_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/* eslint-disable no-multi-assign */
/* eslint-disable prefer-const */
/* eslint-disable no-var */
/* eslint-disable vars-on-top */
/* eslint-disable no-unused-vars */
/* eslint-disable func-names */
/* eslint-disable camelcase */
/* eslint-disable no-undef */
/* eslint-disable no-new-func */
/* eslint-disable strict */

// GENERATED CODE -- DO NOT EDIT!

// Original file comments:
Expand Down
10 changes: 10 additions & 0 deletions examples/grpc/helloworld_pb.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/* eslint-disable prefer-const */
/* eslint-disable no-var */
/* eslint-disable vars-on-top */
/* eslint-disable no-unused-vars */
/* eslint-disable func-names */
/* eslint-disable camelcase */
/* eslint-disable no-undef */
/* eslint-disable no-new-func */
/* eslint-disable strict */

/**
* @fileoverview
* @enhanceable
Expand Down
12 changes: 6 additions & 6 deletions examples/opentracing-shim/shim.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';

const { NodeTracerRegistry } = require("@opentelemetry/node");
const { SimpleSpanProcessor } = require("@opentelemetry/tracing");
const { JaegerExporter } = require("@opentelemetry/exporter-jaeger");
const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin");
const { TracerShim } = require("@opentelemetry/shim-opentracing");
const { NodeTracerRegistry } = require('@opentelemetry/node');
const { SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const { ZipkinExporter } = require('@opentelemetry/exporter-zipkin');
const { TracerShim } = require('@opentelemetry/shim-opentracing');

function shim(serviceName) {
const registry = new NodeTracerRegistry();

registry.addSpanProcessor(new SimpleSpanProcessor(getExporter(serviceName)));

return new TracerShim(registry.getTracer("opentracing-shim"));
return new TracerShim(registry.getTracer('opentracing-shim'));
}

function getExporter(serviceName) {
Expand Down
1 change: 1 addition & 0 deletions examples/postgres/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const tracer = require('./tracer')('postgres-client-service');
// eslint-disable-next-line import/order
const http = require('http');

function makeRequest() {
Expand Down
1 change: 1 addition & 0 deletions examples/postgres/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// eslint-disable-next-line import/order
const tracer = require('./tracer')('postgres-server-service');
const { SpanKind, CanonicalCode } = require('@opentelemetry/types');
const express = require('express');
Expand Down
1 change: 1 addition & 0 deletions examples/redis/client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// eslint-disable-next-line import/order
const tracer = require('./tracer')('example-redis-client');
const types = require('@opentelemetry/types');
const axios = require('axios').default;
Expand Down
2 changes: 2 additions & 0 deletions examples/tracer-web/examples/document-load/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/tracing';
import { WebTracerRegistry } from '@opentelemetry/web';
import { DocumentLoad } from '@opentelemetry/plugin-document-load';
Expand Down

0 comments on commit 462a762

Please sign in to comment.