observability-instrumentation

Emit EMF-based metrics from domain events via event subscribers.

5|Updated May 30, 2023
One-click install
npx skills add https://github.com/VilnaCRM-Org/core-service --skill observability-instrumentation-vilnacrm-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: observability-instrumentation
Source: https://github.com/VilnaCRM-Org/core-service/tree/main/.claude/skills/observability-instrumentation
Command: npx skills add https://github.com/VilnaCRM-Org/core-service --skill observability-instrumentation-vilnacrm-org

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain events and API endpoints often lack structured, business-focused observability. This skill provides a principled way to emit AWS CloudWatch Embedded Metric Format (EMF) metrics from domain events to illuminate business KPIs instead of relying solely on infrastructure metrics.

Core Features & Use Cases

  • Typed, domain-specific metrics emitted via event subscribers (not hardcoded in handlers)
  • EMF-formatted logs that CloudWatch can extract as metrics
  • SOLID architecture with dedicated metric classes, dimension handling, and an emitter
  • Supports single metrics and MetricCollection for batching multiple metrics

Quick Start

Emit a typed EMF metric from a domain event using a dedicated event subscriber.

Frequently Asked Questions about observability-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I emit CloudWatch EMF metrics from PHP domain events?

You emit CloudWatch EMF metrics by using event subscribers that listen for domain events and trigger a dedicated metric emitter. This emitter uses a Monolog EMF channel to format and output metrics that CloudWatch can extract.

What is AWS EMF for business observability and when should I use it?

AWS EMF for business observability is a format that embeds metrics within structured logs to track business KPIs. You use it when domain events and API endpoints lack structured, business-focused observability beyond infrastructure metrics.

How do I structure typed metrics for domain events without hardcoding handlers?

You structure typed metrics by creating dedicated metric classes and dimension data handled by event subscribers. This SOLID architecture decouples metric emission from handlers by using a dedicated emitter for single metrics or collections.

Can I batch multiple domain metrics into a single CloudWatch EMF log?

Yes, you can batch multiple domain metrics into a single CloudWatch EMF log by using a MetricCollection. This allows the dedicated emitter to group multiple typed metrics together for formatted output via the Monolog EMF channel.

Do I need Monolog to output AWS EMF metrics from domain events?

Yes, you need a Monolog EMF channel to format and output AWS EMF metrics from domain events. The architecture requires this logging channel alongside typed metric classes and dimension data to generate extractable CloudWatch metrics.

What is the best way to track business KPIs instead of infrastructure metrics?

The best way to track business KPIs is to emit EMF-based metrics directly from domain events using event subscribers. This provides typed, domain-specific observability through formatted logs that CloudWatch extracts as actionable business metrics.