launchdarkly/launchdarkly-metric-instrument

Instrumenta un evento de métrica de LaunchDarkly en un código base añadiendo una llamada track(). Úsalo cuando el usuario quiera conectar un evento, instrumentar una acción para una métrica, añadir seguimiento a una característica o confirmar que un evento está fluyendo a LaunchDarkly.

¿Qué es launchdarkly-metric-instrument?

Este skill permite instrumentar fácilmente eventos de métrica en LaunchDarkly al agregar la llamada `track()` en el código base. Es útil para desarrolladores que desean conectar eventos personalizados, instrumentar acciones para métricas específicas, agregar seguimiento a características existentes o verificar que los eventos se envíen correctamente a LaunchDarkly. Es compatible con varios lenguajes de programación y SDKs, incluyendo JavaScript, Python, Java, Go, .NET, Ruby y más. El skill analiza el código existente para determinar el punto de instrumentación adecuado, genera el código necesario para la llamada `track()` con los parámetros correctos (incluyendo la clave de métrica y el valor numérico opcional), y puede añadir imports o dependencias faltantes. También verifica que el SDK de LaunchDarkly esté configurado y proporciona sugerencias para validar que los eventos estén fluyendo correctamente al dashboard de LaunchDarkly.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/launchdarkly/agent-skills/tree/main/skills/launchdarkly-metric-instrument

Installed? Explore more Productividad y colaboración skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

¿Qué hace launchdarkly-metric-instrument?

Instrumenta un evento de métrica de LaunchDarkly en un código base añadiendo una llamada track(). Úsalo cuando el usuario quiera conectar un evento, instrumentar una acción para una métrica, añadir seguimiento a una característica o confirmar que un evento está fluyendo a LaunchDarkly.

¿Cómo usarlo?

  1. Identifica la métrica y el contexto del evento: el usuario debe especificar la clave de la métrica que desea instrumentar (definida previamente en el dashboard de LaunchDarkly) y el punto en el código donde ocurre la acción.

  2. Agrega la llamada track(): el skill genera el código necesario para el SDK correspondiente. Por ejemplo:

    • JavaScript (Node.js):

      const client = LaunchDarkly.init('SDK_KEY');
      client.track('mi-metrica-clave', { userId: 'usuario123' }, 1.0);
      
    • Python:

      client.track('mi-metrica-clave', {'userId': 'usuario123'}, 1.0)
      
  3. Verifica la conexión: el skill puede ayudar a confirmar que el SDK está inicializado correctamente y que el evento se envía al dashboard.

Plataformas compatibles

  • JavaScript/Node.js
  • Python
  • Java
  • Go
  • Ruby
  • .NET/C#
  • PHP
  • React Native
  • iOS (Swift)
  • Android (Kotlin/Java)

Detalles técnicos

El skill:

  • Escanea el código base en busca del SDK de LaunchDarkly y su inicialización.
  • Identifica el lugar apropiado para la llamada track() basándose en el contexto del evento.
  • Genera el código de instrumentación con los parámetros correctos (clave de métrica, contexto opcional, valor numérico).
  • Si es necesario, agrega importaciones o declaraciones de dependencia.
  • Sugiere pasos para verificar que el evento esté visible en el dashboard de métricas de LaunchDarkly.

Buenas prácticas

  • Usa nombres de métrica descriptivos y consistentes.
  • Incluye un valor numérico cuando la métrica requiera cuantificación (por ejemplo, tiempo de respuesta, recuento de elementos).
  • Asegúrate de que el contexto del usuario o entidad relevante esté disponible al llamar a track().
  • Verifica en el dashboard que el evento está llegando correctamente.

Ejemplo de flujo

  1. El usuario dice: "Quiero instrumentar un evento cuando se complete una compra".
  2. El skill identifica que la métrica se llama compra-completada.
  3. Encuentra el código de finalización de compra y agrega:
    client.track('compra-completada', { userId, total: amount }, 1.0);
    
  4. Confirma que el evento se envía al dashboard de LaunchDarkly.

Para más información, consulta la documentación de LaunchDarkly sobre track.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

launchdarkly/aiconfig-agent-graphs

DEPRECATED redirect — this skill was renamed to agent-graphs. Do not use this skill; invoke agent-graphs instead. Kept only so old references to aiconfig-agent-graphs still point users to the new name.

launchdarkly/aiconfig-ai-metrics

DEPRECATED redirect — this skill was renamed to built-in-metrics. Do not use this skill; invoke built-in-metrics instead. Kept only so old references to aiconfig-ai-metrics still point users to the new name.

launchdarkly/aiconfig-create

DEPRECATED redirect — this skill was renamed to configs-create. Do not use this skill; invoke configs-create instead. Kept only so old references to aiconfig-create still point users to the new name.

launchdarkly/aiconfig-custom-metrics

DEPRECATED redirect — this skill was renamed to custom-metrics. Do not use this skill; invoke custom-metrics instead. Kept only so old references to aiconfig-custom-metrics still point users to the new name.

launchdarkly/aiconfig-migrate

DEPRECATED redirect — this skill was renamed to migrate. Do not use this skill; invoke migrate instead. Kept only so old references to aiconfig-migrate still point users to the new name.

launchdarkly/aiconfig-online-evals

DEPRECATED redirect — this skill was renamed to online-evals. Do not use this skill; invoke online-evals instead. Kept only so old references to aiconfig-online-evals still point users to the new name.

launchdarkly/aiconfig-projects

DEPRECATED redirect — this skill was renamed to projects. Do not use this skill; invoke projects instead. Kept only so old references to aiconfig-projects still point users to the new name.

launchdarkly/aiconfig-snippets

DEPRECATED redirect — this skill was renamed to snippets. Do not use this skill; invoke snippets instead. Kept only so old references to aiconfig-snippets still point users to the new name.

launchdarkly/aiconfig-targeting

DEPRECATED redirect — this skill was renamed to configs-targeting. Do not use this skill; invoke configs-targeting instead. Kept only so old references to aiconfig-targeting still point users to the new name.

launchdarkly/aiconfig-tools

DEPRECATED redirect — this skill was renamed to tools. Do not use this skill; invoke tools instead. Kept only so old references to aiconfig-tools still point users to the new name.

launchdarkly/aiconfig-update

DEPRECATED redirect — this skill was renamed to configs-update. Do not use this skill; invoke configs-update instead. Kept only so old references to aiconfig-update still point users to the new name.

launchdarkly/aiconfig-variations

DEPRECATED redirect — this skill was renamed to configs-variations. Do not use this skill; invoke configs-variations instead. Kept only so old references to aiconfig-variations still point users to the new name.

launchdarkly/apply

Apply LaunchDarkly SDK onboarding: install dependency (or dual-SDK pair), configure env and secrets with consent, add init at entrypoint(s), verify compile. Nested under sdk-install; next is run.

launchdarkly/detect

Detect repository stack for LaunchDarkly SDK onboarding: languages, frameworks, package managers, monorepo targets, entrypoints, existing LD usage. Nested under sdk-install; next is plan.

launchdarkly/first-flag

Create a boolean first flag, add evaluation, toggle on/off for end-to-end proof. Parent onboarding Step 6; uses MCP, API, or ldcli; optional flag-create skill.

launchdarkly/launchdarkly-experiment-setup

Set up and run experiments in LaunchDarkly. Create experiments with metrics, treatments, and flag config, start iterations to collect data, swap design between iterations, and stop with a winner.

launchdarkly/launchdarkly-flag-cleanup

Safely remove a feature flag from code while preserving production behavior. Use when the user wants to remove a flag from code, delete flag references, or create a PR that hardcodes the winning variation after a rollout is complete.

launchdarkly/launchdarkly-flag-create

Create and configure LaunchDarkly feature flags in a way that fits the existing codebase. Use when the user wants to create a new flag, wrap code in a flag, add a feature toggle, or set up an experiment. Guides exploration of existing patterns before creating.

launchdarkly/launchdarkly-flag-discovery

Audit your LaunchDarkly feature flags to understand the landscape, find stale or launched flags, and assess removal readiness. Use when the user asks about flag debt, stale flags, cleanup candidates, flag health, or wants to understand their flag inventory.

launchdarkly/launchdarkly-flag-targeting

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag configurations between environments. Use when the user wants to change who sees a flag, roll out to a percentage, add targeting rules, or promote config between environments.

Skills relacionados