npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xcelsior/strapi-monitoring

v1.0.2

Published

Monitoring and error tracking plugin for Strapi CMS in the Xcelsior ecosystem.

Downloads

147

Readme

@xcelsior/strapi-monitoring

Monitoring and error tracking plugin for Strapi CMS in the Xcelsior ecosystem.

Installation

pnpm add @xcelsior/strapi-monitoring

Features

Basic Setup

Add to your Strapi configuration:

// config/plugins.ts
export default {
  'xcelsior-monitoring': {
    enabled: true,
    config: {
      service: 'strapi-cms',
      environment: process.env.NODE_ENV,
      sampleRate: 1.0,
    },
  },
};

Error Tracking

Automatic error tracking in your Strapi application:

// In your controllers/services
module.exports = {
  async create(ctx) {
    try {
      const entry = await strapi.entityService.create('api::article.article', {
        data: ctx.request.body,
      });
      return entry;
    } catch (error) {
      // Error will be automatically captured
      throw error;
    }
  },
};

// Manual error capture
strapi.monitor.captureError(error, {
  tags: { component: 'article-service' },
  extra: { articleData: data },
});

Performance Monitoring

Track application performance:

// Automatic transaction tracking
module.exports = {
  async find(ctx) {
    const transaction = strapi.monitor.startTransaction('find-articles');
    
    try {
      const entries = await strapi.entityService.findMany('api::article.article');
      transaction.finish();
      return entries;
    } catch (error) {
      transaction.finish(error);
      throw error;
    }
  },
};

// Performance spans
const span = strapi.monitor.startSpan('database-query');
try {
  await query();
} finally {
  span.finish();
}

Configuration

Plugin Options

interface MonitoringOptions {
  service: string;
  environment: string;
  release?: string;
  sampleRate?: number;
  ignoreErrors?: (string | RegExp)[];
  performance?: {
    enabled: boolean;
    sampleRate?: number;
  };
  breadcrumbs?: {
    enabled: boolean;
    maxBreadcrumbs?: number;
  };
}

Environment Variables

The plugin respects these environment variables:

  • STRAPI_MONITORING_DSN: Connection string for error reporting service
  • STRAPI_MONITORING_ENVIRONMENT: Environment name
  • STRAPI_MONITORING_RELEASE: Release version

Advanced Usage

Custom Context

Add custom context to all events:

// Add global context
strapi.monitor.setContext('deployment', {
  version: '1.0.0',
  region: 'us-east-1',
});

// Add context to specific events
strapi.monitor.captureMessage('Important event', {
  level: 'info',
  tags: { component: 'auth' },
  extra: { userId: '123' },
});

Health Checks

Monitor service health:

const health = strapi.monitor.healthCheck({
  database: async () => {
    await strapi.db.connection.raw('SELECT 1');
    return { status: 'healthy' };
  },
  redis: async () => {
    await strapi.redis.ping();
    return { status: 'healthy' };
  },
});

// Get health status
const status = await health.check();

Custom Metrics

Track application metrics:

// Track custom metrics
strapi.monitor.trackMetric('active_users', 100);
strapi.monitor.trackMetric('response_time', 150, {
  tags: { endpoint: '/api/articles' },
});

Best Practices

Error Handling

try {
  await riskyOperation();
} catch (error) {
  strapi.monitor.captureError(error, {
    tags: { operation: 'riskyOperation' },
    extra: { input: input },
    user: ctx.state.user,
  });
  throw error;
}

Performance Tracking

module.exports = (config, { strapi }) => {
  return async (ctx, next) => {
    const transaction = strapi.monitor.startTransaction(ctx.request.path);
    
    try {
      await next();
    } finally {
      transaction.finish({
        status: ctx.response.status,
        duration: Date.now() - ctx.request.startTime,
      });
    }
  };
};

Breadcrumbs

// Add breadcrumbs for debugging
strapi.monitor.addBreadcrumb({
  category: 'auth',
  message: 'User login attempt',
  level: 'info',
  data: { userId: '123' },
});

License

MIT