Socket
Book a DemoInstallSign in
Socket

@codebayu/usesignoz

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codebayu/usesignoz

The reusable plugin to implement signoz on Nuxt project

1.2.3
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@codebayu/usesignoz

npm

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.

Keywords

nuxt

FAQs

Package last updated on 17 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.