Skip to content

Instantly share code, notes, and snippets.

@eyeezzi
Created July 23, 2019 20:19
Show Gist options
  • Save eyeezzi/0a97395a6ce547aa58892df3985cddae to your computer and use it in GitHub Desktop.
Save eyeezzi/0a97395a6ce547aa58892df3985cddae to your computer and use it in GitHub Desktop.
/* user-simulator */
async function whereami() => {
const span = tracer.startSpan('whereami-request')
const location = await axios.get(`${process.env.API_SERVER_ADDRESS}/whereami`, {
headers: getCarrier(span, tracer)
})
span.finish()
})
function getCarrier(span, tracer) {
const carrier = {}
tracer.inject(span.context(), opentracing.FORMAT_HTTP_HEADERS, carrier)
return carrier
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment