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 xhr for tracer registry
  • Loading branch information
dyladan committed Dec 26, 2019
commit 13f96fd832c10b916cb72fd134e1d22857455a72
9 changes: 2 additions & 7 deletions packages/opentelemetry-plugin-xml-http-request/src/xhr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,13 @@ export interface XMLHttpRequestPluginConfig extends types.PluginConfig {
export class XMLHttpRequestPlugin extends BasePlugin<XMLHttpRequest> {
readonly component: string = 'xml-http-request';
// @TODO align this with all packages #600
readonly version: string = '0.3.0';
moduleName = this.component;

protected _config!: XMLHttpRequestPluginConfig;

private _tasksCount = 0;
private _xhrMem = new WeakMap<XMLHttpRequest, XhrMem>();
private _usedResources = new WeakSet<PerformanceResourceTiming>();

constructor(config: XMLHttpRequestPluginConfig = {}) {
super();
this._config = config;
constructor(protected _config: XMLHttpRequestPluginConfig = {}) {
super('@opentelemetry/plugin-xml-http-request', '0.2.0');
}

/**
Expand Down
22 changes: 15 additions & 7 deletions packages/opentelemetry-plugin-xml-http-request/test/xhr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ import {
import { ZoneScopeManager } from '@opentelemetry/scope-zone';
import * as tracing from '@opentelemetry/tracing';
import * as types from '@opentelemetry/types';
import { PerformanceTimingNames as PTN, WebTracer } from '@opentelemetry/web';
import {
PerformanceTimingNames as PTN,
WebTracerRegistry,
} from '@opentelemetry/web';
import { AttributeNames } from '../src/enums/AttributeNames';
import { EventNames } from '../src/enums/EventNames';
import { XMLHttpRequestPlugin } from '../src/xhr';
import { Tracer } from '@opentelemetry/types';

class DummySpanExporter implements tracing.SpanExporter {
export(spans: any) {}
Expand Down Expand Up @@ -97,7 +101,8 @@ describe('xhr', () => {
let clearData: any;

describe('when request is successful', () => {
let webTracerWithZone: WebTracer;
let webTracerWithZone: Tracer;
let webTracerRegistryWithZone: WebTracerRegistry;
let dummySpanExporter: DummySpanExporter;
let exportSpy: any;
let rootSpan: types.Span;
Expand Down Expand Up @@ -136,7 +141,7 @@ describe('xhr', () => {
spyEntries = sandbox.stub(performance, 'getEntriesByType');
spyEntries.withArgs('resource').returns(resources);

webTracerWithZone = new WebTracer({
webTracerRegistryWithZone = new WebTracerRegistry({
logLevel: LogLevel.ERROR,
httpTextFormat: new B3Format(),
scopeManager: new ZoneScopeManager(),
Expand All @@ -146,9 +151,10 @@ describe('xhr', () => {
}),
],
});
webTracerWithZone = webTracerRegistryWithZone.getTracer('xhr-test');
dummySpanExporter = new DummySpanExporter();
exportSpy = sinon.stub(dummySpanExporter, 'export');
webTracerWithZone.addSpanProcessor(
webTracerRegistryWithZone.addSpanProcessor(
new tracing.SimpleSpanProcessor(dummySpanExporter)
);

Expand Down Expand Up @@ -403,7 +409,8 @@ describe('xhr', () => {
});

describe('when request is NOT successful', () => {
let webTracerWithZone: WebTracer;
let webTracerWithZoneRegistry: WebTracerRegistry;
let webTracerWithZone: Tracer;
let dummySpanExporter: DummySpanExporter;
let exportSpy: any;
let rootSpan: types.Span;
Expand Down Expand Up @@ -434,16 +441,17 @@ describe('xhr', () => {
spyEntries = sandbox.stub(performance, 'getEntriesByType');
spyEntries.withArgs('resource').returns(resources);

webTracerWithZone = new WebTracer({
webTracerWithZoneRegistry = new WebTracerRegistry({
logLevel: LogLevel.ERROR,
scopeManager: new ZoneScopeManager(),
plugins: [new XMLHttpRequestPlugin()],
});
dummySpanExporter = new DummySpanExporter();
exportSpy = sinon.stub(dummySpanExporter, 'export');
webTracerWithZone.addSpanProcessor(
webTracerWithZoneRegistry.addSpanProcessor(
new tracing.SimpleSpanProcessor(dummySpanExporter)
);
webTracerWithZone = webTracerWithZoneRegistry.getTracer('xhr-test');

rootSpan = webTracerWithZone.startSpan('root');

Expand Down