Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Sync @opencensus/web-types to v0.0.13 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
crdgonzalezca authored and draffensperger committed May 22, 2019
1 parent 0c6ad7f commit 67ccdad
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/opencensus-web-core/src/trace/model/tracer-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,9 @@ export class TracerBase implements webTypes.TracerBase {
}
return span;
}

/** Sets the current root span. */
setCurrentRootSpan(root: webTypes.Span) {
// no-op, this is only required in case of tracer with cls.
}
}
2 changes: 1 addition & 1 deletion packages/opencensus-web-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build": "npm run compile",
"clean": "rimraf build/*",
"copytypes": "node scripts/copy-types.js '4a6c3f1ea487ba759e3a90dca69e733bbda8887a' && npm run fix",
"copytypes": "node scripts/copy-types.js 'v0.0.13' && npm run fix",
"check": "gts check",
"compile": "tsc -p .",
"fix": "gts fix",
Expand Down
12 changes: 11 additions & 1 deletion packages/opencensus-web-types/src/trace/instrumentation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { Stats } from '../../stats/types';
import { TracerBase } from '../model/types';
import { Span, TracerBase } from '../model/types';

/** Interface Plugin to apply patch. */
export interface Plugin {
Expand All @@ -41,9 +41,19 @@ export interface Plugin {
disable(): void;
}

/**
* Function that can be provided to plugin in order to add custom
* attributes to spans
*/
export interface CustomAttributeFunction {
// tslint:disable-next-line:no-any
(span: Span, ...rest: any[]): void;
}

export interface PluginConfig {
// tslint:disable-next-line:no-any
[key: string]: any;
applyCustomAttributesOnSpan?: CustomAttributeFunction;
}

export interface NamedPluginConfig {
Expand Down
6 changes: 5 additions & 1 deletion packages/opencensus-web-types/src/trace/model/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ export interface SpanContext {

/** Defines an end span event listener */
export interface SpanEventListener {
/** Happens when a span is ended */
/** Happens when a span is started */
onStartSpan(span: Span): void;
/** Happens when a span is ended */
onEndSpan(span: Span): void;
}

Expand Down Expand Up @@ -528,6 +529,9 @@ export interface TracerBase extends SpanEventListener {
* @returns The new Span instance started
*/
startChildSpan(options?: SpanOptions): Span;

/** Sets the current root span. */
setCurrentRootSpan(root: Span): void;
}

/** Interface for Tracer */
Expand Down

0 comments on commit 67ccdad

Please sign in to comment.