This repository was archived by the owner on Oct 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +14
-0
lines changed
packages/opencensus-core/src Expand file tree Collapse file tree 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -20,5 +20,6 @@ export * from './trace/model/types';
2020export * from './trace/config/types' ;
2121export * from './trace/sampler/types' ;
2222export * from './trace/instrumentation/types' ;
23+ export * from './trace/propagation/types' ;
2324export * from './exporters/types' ;
2425export * from './common/types' ;
Original file line number Diff line number Diff line change 1717import { Logger } from '../../common/types' ;
1818import { Exporter } from '../../exporters/types' ;
1919import { PluginNames } from '../instrumentation/types' ;
20+ import { Propagation } from '../propagation/types' ;
2021
2122/** Interface configuration for a buffer. */
2223export interface BufferConfig {
@@ -36,6 +37,8 @@ export interface TracerConfig {
3637 ignoreUrls ?: Array < string | RegExp > ;
3738 /** A logger object */
3839 logger ?: Logger ;
40+ /** A propagation instance */
41+ propagation ?: Propagation ;
3942}
4043
4144/** Available configuration options. */
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import * as logger from '../../common/console-logger';
1818import * as loggerTypes from '../../common/types' ;
1919import * as cls from '../../internal/cls' ;
2020import * as configTypes from '../config/types' ;
21+ import { Propagation } from '../propagation/types' ;
2122import { Sampler } from '../sampler/sampler' ;
2223import * as samplerTypes from '../sampler/types' ;
2324
@@ -64,6 +65,11 @@ export class Tracer implements types.Tracer {
6465 this . contextManager . set ( 'rootspan' , root ) ;
6566 }
6667
68+ /** A propagation instance */
69+ get propagation ( ) : Propagation {
70+ return this . config ? this . config . propagation : null ;
71+ }
72+
6773 /**
6874 * Starts a tracer.
6975 * @param config A tracer configuration object to start a tracer.
Original file line number Diff line number Diff line change 1616
1717import * as loggerTypes from '../../common/types' ;
1818import * as configTypes from '../config/types' ;
19+ import { Propagation } from '../propagation/types' ;
1920import * as samplerTypes from '../sampler/types' ;
2021
2122
@@ -222,6 +223,9 @@ export interface Tracer extends OnEndSpanEventListener {
222223 /** A configuration for starting the tracer */
223224 logger : loggerTypes . Logger ;
224225
226+ /** A propagation instance */
227+ readonly propagation : Propagation ;
228+
225229 /** Get the eventListeners from tracer instance */
226230 readonly eventListeners : OnEndSpanEventListener [ ] ;
227231
You can’t perform that action at this time.
0 commit comments