1.2.3 • Published 1 year ago
@codebayu/usesignoz v1.2.3
@codebayu/usesignoz
A utility package to simplify the integration of Signoz (OpenTelemetry-based observability) in Nuxt.js projects.
Installation
# npm
npm install @codebayu/usesignoz
# yarn
yarn add @codebayu/usesignoz
Usage
initTracer
import { initTracer } from '@codebayu/usesignoz';
const tracer = initTracer({
serviceName: 'your-service-name',
exporterUrl: 'http://your-exporter-url',
attributes: {
path: '/example',
uuid: 'user-123',
},
});
createSpan
import { createSpan } from '@codebayu/usesignoz';
const spanName = 'your-span-name';
createSpan({
tracer,
name: spanName,
func: () => {
// Your code to be executed within the span
},
attributes: {
key1: 'value1',
key2: 'value2',
},
events: {
name: 'event-name',
keyValue: { key: 'value' },
},
});
Example
import { initTracer, createSpan } from '@codebayu/usesignoz';
const tracer = initTracer({
serviceName: 'example-nuxt-project',
exporterUrl: 'http://127.0.0.1:4318/v1/traces',
attributes: {
path: '/example',
uuid: 'user-123',
},
});
// Creating a span for a specific operation
createSpan({
tracer,
name: 'example-operation',
func: () => {
// Your code for the operation
console.log('Executing example operation...');
},
attributes: {
key1: 'value1',
key2: 'value2',
},
events: {
name: 'operation-event',
keyValue: { status: 'completed' },
},
});
License
This project is licensed under the MIT License - see the LICENSE file for details.
1.2.3
1 year ago
1.2.0
1 year ago
1.1.0
1 year ago
1.2.2
1 year ago
1.2.1
1 year ago
1.0.11
1 year ago
1.0.10
1 year ago
1.0.14
1 year ago
1.0.13
1 year ago
1.0.12
1 year ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago