How to use the @opencensus/propagation-b3.B3Format function in @opencensus/propagation-b3

To help you get started, we’ve selected a few @opencensus/propagation-b3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thesandlord / Istio101 / code / code-opencensus-full / index.js View on Github external
*/
const port = process.env.PORT || 3000
const upstream_uri = process.env.UPSTREAM_URI || 'http://worldclockapi.com/api/json/utc/now'
const service_name = process.env.SERVICE_NAME || 'opencensus-test-1-v1'

const express = require('express')
const app = express()
const request = require('request-promise-native')


// Start of OpenCensus setup ----------------------------------------------------------------------------

const opencensus = require('@opencensus/core')
const tracing = require('@opencensus/nodejs')
const propagation = require('@opencensus/propagation-b3')
const b3 = new propagation.B3Format()

// Set up jaeger
const jaeger = require('@opencensus/exporter-jaeger')

const jaeger_host = process.env.JAEGER_HOST || 'localhost'
const jaeger_port = process.env.JAEGER_PORT || '6832'

const exporter = new jaeger.JaegerTraceExporter({
	host: jaeger_host,
    port: jaeger_port,
	serviceName: service_name,
});

tracing.start({
	propagation: b3,
	samplingRate: 1.0,
github magma / magma / symphony / app / fbcnms-projects / platform-server / scripts / server.js View on Github external
jaegerExporter.sender = new HTTPSender({
      ...jaegerOptions,
      endpoint: process.env.JAEGER_COLLECTOR_ENDPOINT,
    });
    jaegerExporter.sender.setProcess(jaegerExporter.process);
  }
}

tracing.start({
  samplingRate: 1,
  plugins: {
    http: '@opencensus/instrumentation-http',
  },
  stats: globalStats,
  exporter: jaegerExporter,
  propagation: jaegerExporter ? new B3Format() : null,
});

(async function main() {
  for (;;) {
    try {
      await sequelize.authenticate();
      break;
    } catch (error) {
      logger.error('cannot connect to database', error);
      await new Promise(res => setTimeout(res, 2000));
    }
  }
  await runMigrations();
  app.listen(port, '', err => {
    if (err) {
      logger.error(err.toString());
github thesandlord / Istio101 / code / code-opencensus-simple / index.js View on Github external
https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
const port = process.env.PORT || 3000
const upstream_uri = process.env.UPSTREAM_URI || 'http://worldclockapi.com/api/json/utc/now'
const service_name = process.env.SERVICE_NAME || 'opencensus-test-1-v1'

const tracing = require('@opencensus/nodejs');
const propagation = require('@opencensus/propagation-b3');
const b3 = new propagation.B3Format();

tracing.start({
	propagation: b3,
	samplingRate: 1.0
});

const express = require('express')
const app = express()
const request = require('request-promise-native')

app.get('/', async(req, res) => {
	const begin = Date.now()

	let up
	try {
		up = await request({
github keymetrics / pm2-io-apm / src / features / tracing.ts View on Github external
config: { detailedCommands: config.tracing.detailedDatabasesCalls }
      },
      'vue-server-renderer': {
        module: resolve(__dirname, '../census/plugins/vue'),
        config: {}
      }
    }
    if (this.options.createSpanWithNet === true) {
      plugins['net'] = {
        module: resolve(__dirname, '../census/plugins/net')
      }
    }
    this.tracer = tracer.start({
      exporter: this.exporter,
      plugins,
      propagation: new B3Format(),
      samplingRate: this.options.samplingRate || 0.5,
      logLevel: this.isDebugEnabled() ? 4 : 1
    })
    Configuration.configureModule({
      census_tracing: true
    })
  }

@opencensus/propagation-b3

Opencensus propagation package for B3 format.

Apache-2.0
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis

Popular @opencensus/propagation-b3 functions