Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 664 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 664 Bytes

Coralogix Opentelemetry

Flows With Express

To use coralogix flows with express you must use the setExpressApp function to make sure that the coralogix sampler understands your routes and endpoints.

Example:

const sampler = new CoralogixTransactionSampler();

const tracerProvider = new BasicTracerProvider({
    resource: new Resource({
        [SemanticResourceAttributes.SERVICE_NAME]: '<your-service-name>'
    }),
    sampler
});
import express from "express";
import router from "./router";

const app = express();
app.use('/', router);

sampler.setExpressApp(app);

app.listen(3000, () => {
    console.log('Server is running')
});