Skip to content

Commit

Permalink
Merge branch 'main' into jeager-propagate-baggage
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud authored May 11, 2021
2 parents 067266f + 5cd02aa commit c63878b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
26 changes: 11 additions & 15 deletions examples/http/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@ function handleRequest(request, response) {
});
// Annotate our span to capture metadata about the operation
span.addEvent('invoking handleRequest');
try {
const body = [];
request.on('error', (err) => console.log(err));
request.on('data', (chunk) => body.push(chunk));
request.on('end', () => {
// deliberately sleeping to mock some action.
setTimeout(() => {
span.end();
response.end('Hello World!');
}, 2000);
});
} catch (err) {
console.error(err);
span.end();
}

const body = [];
request.on('error', (err) => console.log(err));
request.on('data', (chunk) => body.push(chunk));
request.on('end', () => {
// deliberately sleeping to mock some action.
setTimeout(() => {
span.end();
response.end('Hello World!');
}, 2000);
});
}

startServer(8080);
26 changes: 11 additions & 15 deletions examples/https/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,17 @@ function handleRequest(request, response) {
});
// Annotate our span to capture metadata about the operation
span.addEvent('invoking handleRequest');
try {
const body = [];
request.on('error', (err) => console.log(err));
request.on('data', (chunk) => body.push(chunk));
request.on('end', () => {
// deliberately sleeping to mock some action.
setTimeout(() => {
span.end();
response.end('Hello World!');
}, 2000);
});
} catch (err) {
console.log(err);
span.end();
}

const body = [];
request.on('error', (err) => console.log(err));
request.on('data', (chunk) => body.push(chunk));
request.on('end', () => {
// deliberately sleeping to mock some action.
setTimeout(() => {
span.end();
response.end('Hello World!');
}, 2000);
});
}

startServer(443);
1 change: 1 addition & 0 deletions packages/opentelemetry-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export * from './trace/sampler/AlwaysOnSampler';
export * from './trace/sampler/ParentBasedSampler';
export * from './trace/sampler/TraceIdRatioBasedSampler';
export * from './trace/TraceState';
export * from './utils/environment';
export * from './utils/sampling';
export * from './utils/url';
export * from './utils/wrap';
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-tracing/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import {
getEnv,
TracesSamplerValues,
ParentBasedSampler,
ENVIRONMENT,
TraceIdRatioBasedSampler,
} from '@opentelemetry/core';
import { ENVIRONMENT } from '@opentelemetry/core/src/utils/environment';

const env = getEnv();
const FALLBACK_OTEL_TRACES_SAMPLER = TracesSamplerValues.AlwaysOn;
Expand Down

0 comments on commit c63878b

Please sign in to comment.