Skip to content

Commit

Permalink
Merge pull request #483 from polywrap/prealpha-dev
Browse files Browse the repository at this point in the history
prep 0.0.1-prealpha.45
  • Loading branch information
dOrgJelli authored Sep 23, 2021
2 parents a9b4fe3 + 7058a0c commit 6239db2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Web3API 0.0.1-prealpha.45
## Features
* `@web3api/tracing-js`: Support service name configuration.

# Web3API 0.0.1-prealpha.44
## Features
* `@web3api/client-js`: Use Fleek's IPFS gateway.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.1-prealpha.44
0.0.1-prealpha.45
12 changes: 8 additions & 4 deletions packages/js/tracing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export class Tracer {
| null = null;
private static _spans: Array<api.Span> = [];

static enableTracing(tracerName: string): void {
static enableTracing(tracerName: string, serviceName = "Polywrap"): void {
this.traceEnabled = true;
this._initProvider();
this._initProvider(serviceName);

if (this._provider) {
this._tracer = this._provider.getTracer(tracerName) as otTracer;
Expand Down Expand Up @@ -129,7 +129,7 @@ export class Tracer {
};
}

static _initProvider(): void {
static _initProvider(serviceName: string): void {
if (this._provider) return;

if (typeof window === "undefined") {
Expand All @@ -140,7 +140,11 @@ export class Tracer {

// Configure span processor to send spans to the exporter
this._provider.addSpanProcessor(
new SimpleSpanProcessor(new ZipkinExporter())
new SimpleSpanProcessor(
new ZipkinExporter({
serviceName: serviceName,
})
)
);

this._provider.register();
Expand Down

0 comments on commit 6239db2

Please sign in to comment.