Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named Tracers / Tracer Registry #582

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d75f53e
feat: spike of named tracer registry
dyladan Dec 2, 2019
ead9f16
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 2, 2019
50927cd
chore: mysql/mongo tracer registry support
dyladan Dec 2, 2019
c686117
fix: lint
dyladan Dec 2, 2019
7dba62c
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 2, 2019
14fa061
chore: add getTracer back
dyladan Dec 2, 2019
b1e887c
chore: change default tracer name to empty string
dyladan Dec 2, 2019
5ca0209
fix: lint
dyladan Dec 2, 2019
217d3b3
Merge branch 'master' into tracer-registry
dyladan Dec 2, 2019
61f4618
chore: update examples for registry
dyladan Dec 2, 2019
33dd773
Merge branch 'tracer-registry' of github.com:dynatrace-oss-contrib/op…
dyladan Dec 2, 2019
6f81608
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 10, 2019
0687f1c
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 17, 2019
cc4eba9
chore(tracer-registry): make name required
dyladan Dec 17, 2019
9d95597
chore: lint
dyladan Dec 17, 2019
3237f99
chore: update examples for required tracer name
dyladan Dec 17, 2019
643e286
chore: remove unused tracer delegate
dyladan Dec 17, 2019
508ff33
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 18, 2019
41c1168
chore: remove references to basic tracer
dyladan Dec 23, 2019
6a94efe
chore: remove references to NodeTracer
dyladan Dec 23, 2019
4693d22
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 26, 2019
13f96fd
chore: update xhr for tracer registry
dyladan Dec 26, 2019
38ffef8
chore: update tracer names to match package names
dyladan Dec 26, 2019
9915a2c
chore: add version script to all packages
dyladan Dec 26, 2019
69ff01f
chore: update plugins to use version script
dyladan Dec 26, 2019
40c4301
chore: add jsdoc to noop tracer registry
dyladan Dec 27, 2019
1eea9d2
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Dec 27, 2019
660f41f
chore: update ioredis for tracer registry
dyladan Dec 27, 2019
8e6399e
chore: update pg pool for tracer registry
dyladan Dec 27, 2019
bd0be2c
fix: lint
dyladan Dec 30, 2019
30a1b36
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Jan 3, 2020
7c39151
chore: fix tests
dyladan Jan 3, 2020
e814df6
chore: lint
dyladan Jan 3, 2020
0ec5b82
Merge remote-tracking branch 'upstream/master' into tracer-registry
dyladan Jan 6, 2020
cd47354
chore: lint
dyladan Jan 6, 2020
bfa8bfa
Merge branch 'master' into tracer-registry
mayurkale22 Jan 9, 2020
5740098
Merge branch 'master' into tracer-registry
mayurkale22 Jan 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update plugins to use version script
  • Loading branch information
dyladan committed Dec 26, 2019
commit 69ff01f06ee594d474676fface055c418ca85f1e
23 changes: 12 additions & 11 deletions packages/opentelemetry-plugin-dns/src/dns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
* limitations under the License.
*/

import * as shimmer from 'shimmer';
import * as semver from 'semver';
import * as utils from './utils';
import { BasePlugin } from '@opentelemetry/core';
import { SpanOptions, SpanKind, Span } from '@opentelemetry/types';
import { Span, SpanKind, SpanOptions } from '@opentelemetry/types';
import { LookupAddress } from 'dns';
import * as semver from 'semver';
import * as shimmer from 'shimmer';
import { AddressFamily } from './enums/AddressFamily';
import { AttributeNames } from './enums/AttributeNames';
import {
Dns,
LookupPromiseSignature,
DnsPluginConfig,
LookupCallbackSignature,
LookupFunction,
LookupFunctionSignature,
LookupCallbackSignature,
DnsPluginConfig,
LookupPromiseSignature,
} from './types';
import { AttributeNames } from './enums/AttributeNames';
import { AddressFamily } from './enums/AddressFamily';
import { LookupAddress } from 'dns';
import * as utils from './utils';
import { VERSION } from './version';

/**
* Dns instrumentation plugin for Opentelemetry
Expand All @@ -39,7 +40,7 @@ export class DnsPlugin extends BasePlugin<Dns> {
protected _config!: DnsPluginConfig;

constructor(readonly moduleName: string, readonly version: string) {
super('@opentelemetry/plugin-dns', '0.3.1');
super('@opentelemetry/plugin-dns', VERSION);
// For now component is equal to moduleName but it can change in the future.
this.component = this.moduleName;
this._config = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import {
TRACE_PARENT_HEADER,
} from '@opentelemetry/core';
import { PluginConfig, Span, SpanOptions } from '@opentelemetry/types';
import { AttributeNames } from './enums/AttributeNames';
import {
addSpanNetworkEvent,
hasKey,
PerformanceEntries,
PerformanceLegacy,
PerformanceTimingNames as PTN,
} from '@opentelemetry/web';
import { AttributeNames } from './enums/AttributeNames';
import { VERSION } from './version';

/**
* This class represents a document load plugin
Expand All @@ -44,7 +45,7 @@ export class DocumentLoad extends BasePlugin<unknown> {
* @param config
*/
constructor(config: PluginConfig = {}) {
super('@opentelemetry/plugin-document-load', '0.3.1');
super('@opentelemetry/plugin-document-load', VERSION);
this._onDocumentLoaded = this._onDocumentLoaded.bind(this);
this._config = config;
}
Expand Down
26 changes: 13 additions & 13 deletions packages/opentelemetry-plugin-grpc/src/grpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@

import { BasePlugin } from '@opentelemetry/core';
import {
CanonicalCode,
Span,
SpanContext,
SpanKind,
SpanOptions,
Span,
Status,
CanonicalCode,
SpanContext,
} from '@opentelemetry/types';
import * as events from 'events';
import * as grpcTypes from 'grpc';
import * as path from 'path';
import * as shimmer from 'shimmer';
import { AttributeNames } from './enums/AttributeNames';
import {
grpc,
ModuleExportsMapping,
GrpcPluginOptions,
ServerCallWithMeta,
SendUnaryDataCallback,
GrpcClientFunc,
GrpcInternalClientTypes,
GrpcPluginOptions,
ModuleExportsMapping,
SendUnaryDataCallback,
ServerCallWithMeta,
} from './types';
import {
findIndex,
_grpcStatusCodeToCanonicalCode,
_grpcStatusCodeToSpanStatus,
} from './utils';

import * as events from 'events';
import * as grpcTypes from 'grpc';
import * as shimmer from 'shimmer';
import * as path from 'path';
import { VERSION } from './version';

/** The metadata key under which span context is stored as a binary value. */
export const GRPC_TRACE_KEY = 'grpc-trace-bin';
Expand All @@ -56,7 +56,7 @@ export class GrpcPlugin extends BasePlugin<grpc> {
protected _config!: GrpcPluginOptions;

constructor(readonly moduleName: string, readonly version: string) {
super('@opentelemetry/plugin-grpc', '0.3.1');
super('@opentelemetry/plugin-grpc', VERSION);
this._config = {};
}

Expand Down
21 changes: 11 additions & 10 deletions packages/opentelemetry-plugin-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

import { BasePlugin, isValid } from '@opentelemetry/core';
import {
Attributes,
CanonicalCode,
Span,
SpanKind,
SpanOptions,
Attributes,
CanonicalCode,
Status,
} from '@opentelemetry/types';
import {
Expand All @@ -33,18 +33,19 @@ import {
import * as semver from 'semver';
import * as shimmer from 'shimmer';
import * as url from 'url';
import { AttributeNames } from './enums/AttributeNames';
import { Format } from './enums/Format';
import {
HttpPluginConfig,
Http,
Err,
Func,
ResponseEndArgs,
ParsedRequestOptions,
Http,
HttpPluginConfig,
HttpRequestArgs,
Err,
ParsedRequestOptions,
ResponseEndArgs,
} from './types';
import { Format } from './enums/Format';
import { AttributeNames } from './enums/AttributeNames';
import * as utils from './utils';
import { VERSION } from './version';

/**
* Http instrumentation plugin for Opentelemetry
Expand All @@ -56,7 +57,7 @@ export class HttpPlugin extends BasePlugin<Http> {
private readonly _spanNotEnded: WeakSet<Span>;

constructor(readonly moduleName: string, readonly version: string) {
super(`@opentelemetry/plugin-${moduleName}`, '0.3.1');
super(`@opentelemetry/plugin-${moduleName}`, VERSION);
// For now component is equal to moduleName but it can change in the future.
this.component = this.moduleName;
this._spanNotEnded = new WeakSet<Span>();
Expand Down
13 changes: 7 additions & 6 deletions packages/opentelemetry-plugin-mongodb-core/src/mongodb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@
/* tslint:disable:deprecation */

import { BasePlugin } from '@opentelemetry/core';
import { Span, SpanKind, CanonicalCode } from '@opentelemetry/types';
import { CanonicalCode, Span, SpanKind } from '@opentelemetry/types';
import * as mongodb from 'mongodb';
import * as shimmer from 'shimmer';
import {
AttributeNames,
Func,
MongodbCommandType,
MongoInternalCommand,
MongoInternalTopology,
AttributeNames,
MongodbCommandType,
} from './types';
import * as mongodb from 'mongodb';
import * as shimmer from 'shimmer';
import { VERSION } from './version';

/** MongoDBCore instrumentation plugin for OpenTelemetry */
export class MongoDBCorePlugin extends BasePlugin<typeof mongodb> {
Expand All @@ -40,7 +41,7 @@ export class MongoDBCorePlugin extends BasePlugin<typeof mongodb> {
readonly supportedVersions = ['>=2 <3'];

constructor(readonly moduleName: string) {
super('@opentelemetry/plugin-mongodb-core', '0.3.1');
super('@opentelemetry/plugin-mongodb-core', VERSION);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion packages/opentelemetry-plugin-mysql/src/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as mysqlTypes from 'mysql';
import * as shimmer from 'shimmer';
import { AttributeNames } from './enums';
import { getConnectionAttributes, getSpanName } from './utils';
import { VERSION } from './version';

export class MysqlPlugin extends BasePlugin<typeof mysqlTypes> {
readonly supportedVersions = ['2.*'];
Expand All @@ -36,7 +37,7 @@ export class MysqlPlugin extends BasePlugin<typeof mysqlTypes> {
private _enabled = false;

constructor(readonly moduleName: string) {
super('@opentelemetry/plugin-mysql', '0.3.1');
super('@opentelemetry/plugin-mysql', VERSION);
}

protected patch(): typeof mysqlTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

import { BasePlugin } from '@opentelemetry/core';
import { CanonicalCode, Span } from '@opentelemetry/types';
import * as pgTypes from 'pg';
import * as shimmer from 'shimmer';
import {
PostgresPluginOptions,
PgClientExtended,
PgPluginQueryConfig,
PostgresCallback,
PostgresPluginOptions,
} from './types';
import * as pgTypes from 'pg';
import * as shimmer from 'shimmer';
import * as utils from './utils';
import { VERSION } from './version';

export class PostgresPlugin extends BasePlugin<typeof pgTypes> {
protected _config: PostgresPluginOptions;
Expand All @@ -37,7 +38,7 @@ export class PostgresPlugin extends BasePlugin<typeof pgTypes> {
readonly supportedVersions = ['7.*'];

constructor(readonly moduleName: string) {
super('@opentelemetry/plugin-pg', '0.3.1');
super('@opentelemetry/plugin-pg', VERSION);
this._config = {};
}

Expand Down
3 changes: 2 additions & 1 deletion packages/opentelemetry-plugin-redis/src/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ import {
getTracedCreateStreamTrace,
getTracedInternalSendCommand,
} from './utils';
import { VERSION } from './version';

export class RedisPlugin extends BasePlugin<typeof redisTypes> {
static readonly COMPONENT = 'redis';
readonly supportedVersions = ['^2.6.0']; // equivalent to >= 2.6.0 <3

constructor(readonly moduleName: string) {
super("@opentelemetry/plugin-redis", "0.3.1");
super('@opentelemetry/plugin-redis', VERSION);
}

protected patch() {
Expand Down
3 changes: 2 additions & 1 deletion packages/opentelemetry-plugin-xml-http-request/src/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
SendFunction,
XhrMem,
} from './types';
import { VERSION } from './version';

// how long to wait for observer to collect information about resources
// this is needed as event "load" is called before observer
Expand Down Expand Up @@ -72,7 +73,7 @@ export class XMLHttpRequestPlugin extends BasePlugin<XMLHttpRequest> {
private _usedResources = new WeakSet<PerformanceResourceTiming>();

constructor(protected _config: XMLHttpRequestPluginConfig = {}) {
super('@opentelemetry/plugin-xml-http-request', '0.3.1');
super('@opentelemetry/plugin-xml-http-request', VERSION);
}

/**
Expand Down