{"ref":"artifact:cap-js-community-business-metrics","page":"/artifacts/cap-js-community-business-metrics","json":"/artifacts/cap-js-community-business-metrics.json","generated":"2026-11-15","drafted_with_ai":true,"entity":{"id":"cap-js-community-business-metrics","name":"@cap-js-community/business-metrics","artifact_type":"cds-plugin","ecosystem":"cap","domain":"operations-and-runtime","origin_ring":"community-org","description":{"one_line":"An extension of [@cap-js/telemetry](artifact:cap-js-telemetry) that turns two CDS annotations into business metrics, a counter on an entity event or action and a gauge on numeric fields.","short":"Business-level metrics from CDS annotations via @cap-js/telemetry","what_it_solves":"@cap-js-community/business-metrics is an extension library for [@cap-js/telemetry](artifact:cap-js-telemetry) that turns two CDS annotations into metrics, so a count the business asks for is declared in the model instead of written as OpenTelemetry API calls. @UsageMetering.Counting on a service entity or an action emits a counter, raised on the CRUD event the annotation names or on each call of the action, and the annotation's qualifier becomes the metric name. @UsageMetering.Gauge observes numeric fields of an entity, a stock level for instance, under a name fixed to the service and the entity. It needs telemetry enabled in the application's configuration and enableBusinessMetrics set under cds.requires.telemetry.metrics, tenant is the only dimension it captures, and the README asks that no field holding personal data is observed."},"links":{"npm":"https://www.npmjs.com/package/@cap-js-community/business-metrics","repo":"https://github.com/cap-js-community/business-metrics"},"identity":{"author":"cap-js-community","license":"Apache-2.0"},"compat":{"runtimes":["node"]},"type_properties":{"distribution":{"value":["npm"],"sources":[{"url":"https://github.com/cap-js-community/business-metrics","title":"@cap-js-community/business-metrics — README","checked":"2026-10-18","quote":"1. Add `business-metrics` to your dependencies via npm add `@cap-js-community/business-metrics`"}]}},"provides":[{"capability":"capability:telemetry","what_it_does":"Emits counter and gauge metrics declared in the CDS model: a counter per annotated entity CRUD event or action call, and a gauge over the numeric fields an entity annotation names, with the tenant as the one available dimension.","sources":[{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, About this project","checked":"2026-10-15","quote":"It allows you to effortlessly track usage and performance by integrating Counter and Gauge metrics directly into your CAP service entities and actions."},{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, Features","checked":"2026-10-15","quote":"- **Counter Metrics**: Track the number of times specific events occur for service entities or actions (e.g., READ, DELETE or custom actions like releaseSalesOrder)."},{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, Features","checked":"2026-10-15","quote":"- **Gauge Metrics**: Monitor and observe specific fields of entities, such as stock levels or other numeric values."},{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, Counting Annotation","checked":"2026-10-15","quote":"The library supports the capture of tenant information only."}],"facets":[{"key":"signals","value":["Metrics"],"source":{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, About this project","checked":"2026-10-15","quote":"It allows you to effortlessly track usage and performance by integrating Counter and Gauge metrics directly into your CAP service entities and actions."}},{"key":"instrumented_by","value":["CDS annotations"],"source":{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, Counting Annotation","checked":"2026-10-15","quote":"Use the `@UsageMetering.Counting` annotation in your `services.cds` file to enable counter metrics for specific entities or actions."}}]}],"requires":[{"ref":"artifact:cap-js-telemetry","requirement":"required","role":"metrics-pipeline","for":"The metrics are produced through the telemetry plugin this library extends, and its README lists telemetry enabled in the CAP application configuration among the prerequisites.","sources":[{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, About this project","checked":"2026-10-15","quote":"**Business-metrics** is an extension library for **@cap-js/telemetry** designed for CAP (Cloud Application Programming) applications."},{"url":"https://raw.githubusercontent.com/cap-js-community/business-metrics/eee01d0e28e5a76bdb3d58900f8068d516d1ab17/README.md","title":"Business-metrics — README, Requirements and Setup","checked":"2026-10-15","quote":"- Telemetry enabled in the CAP application configuration"}]}],"provenance":{"discovered_via":[{"source":"source:npm"},{"source":"source:github","channel":"cap-js-community"}],"first_seen":"2026-08-31"},"maintainers":["actor:cap-js-community"],"contributors":["actor:ashutoshtghorat","actor:bhoomikabedra","actor:chgeo","actor:hrsthrdy","actor:ks-prathiksha","actor:ksprathiksha","actor:prathikshaks","actor:sahumadhusudan","actor:sjvans"],"drafted_with_ai":true,"history":[{"date":"2026-10-15","field":"description.what_it_solves, provides, requires","from":"a bare provides ref and a one-line description","to":"what it does for telemetry, its two stated properties, and the edge to the plugin it extends","reason":"Telemetry curation for the CAP door. The README opens by calling it an extension library for @cap-js/telemetry and lists telemetry enabled in the application configuration as a prerequisite, and the graph held no edge between the two. Read against the README at commit eee01d0."}]},"effective_normative_relations":[{"instrument":"instrument:sap-developer-license-3-2-cap","relation":"use-constrained-by","sections":["1","2","3"],"applies_when":"A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.","note":"This is inherited applicability, not a licence verdict about the artifact itself. Review the agreement for the actual materials and use; an explicit artifact relationship to another revision takes precedence.","scope":{"kind":"artifact"},"sources":[{"url":"https://cap.cloud.sap/resources/license/developer-license-3_2_CAP.txt","title":"SAP Developer License Agreement 3.2 CAP","checked":"2026-09-16","quote":"documentation, plug-ins, templates, scripts and sample code, libraries, software development kits"}],"inherited_from":"cap-plugins-and-applications","relevant_capabilities":["agent-systems-access","async-processing","data-import-export","database-connectors","deployment","destinations","llm-integration","mcp-servers","plugin-authoring","replication","retrieval-augmented-generation","rfc-connectivity"]}],"readings":{"liveness":[{"label":"Maintenance","tier":"fair","evidence":"5 months since release"},{"label":"Continuity","tier":"good","evidence":"10 contributors, 3 publishers, org-owned"},{"label":"Repository","tier":"good","evidence":"pushed 2026-10, not archived"}],"compatibility":[{"label":"Declared for","tier":"good","evidence":">=9 — includes cds 10 and 9"},{"label":"Survived majors","tier":"poor","evidence":"no release since @sap/cds 10 shipped (July 2026)"},{"label":"Maintainer's CI","tier":"good","evidence":"CI green, 2026-08-26"}],"practice":[{"label":"Tests","tier":"good","evidence":"12 test files, npm test"},{"label":"Docs","tier":"good","evidence":"README 6 KB"},{"label":"Changelog","tier":"good","evidence":"CHANGELOG in the repo"}],"reach":[{"value":4,"unit":"installs/week"},{"value":3,"unit":"watching"}]},"signals":{"crawled_at":"2026-11-15","latest_version":"1.0.0","majors":{"1":{"version":"1.0.0","date":"2026-06-22"},"0.0":{"version":"0.0.0","date":"2026-06-18"}},"license":"Apache-2.0","first_release":"2026-06-18","last_release":"2026-06-22","releases":2,"cadence_days":null,"maintainers":3,"repository":"git+https://github.com/cap-js-community/business-metrics.git","peer_cds":">=9","test_script":true,"types":false,"downloads_weekly":4,"stars":3,"forks":1,"open_issues":3,"archived":false,"pushed_at":"2026-10-26","license_spdx":"Apache-2.0","org_owned":true,"default_branch":"main","contributors":10,"tree_truncated":false,"test_files":12,"workflows":2,"other_ci":false,"readme_bytes":6259,"docs_files":0,"changelog":true,"license_file":true,"dts_files":0,"ci_status":"success","ci_run_at":"2026-08-26","ci_workflow":"CI","ci_event":"push","readme_path":"README.md","readme_sha":"2fc09b186288ab116cc51c6d57e7f97b2691a27f","months_since_release":5,"dormant":false,"repository_directory":null,"dependencies":1,"node_engine":null,"downloads_monthly":46,"created_at":"2025-04-30T09:24:41Z","open_prs":2,"first_commit":"2025-04-30","last_commit":"2026-08-26","commits":125,"repo_read":"2026-11-15","language":"JavaScript"},"release_notes":{"license":"Apache-2.0","quotable":true,"source":{"kind":"repo","path":"CHANGELOG.md","ref":"main","url":"https://github.com/cap-js-community/business-metrics/blob/main/CHANGELOG.md"},"format":"keep-a-changelog","releases":[{"version":"1.0.0","date":"2026-06-17","date_source":"heading","heading":"Version 1.0.0 - 2026-06-17","url":"https://github.com/cap-js-community/business-metrics/blob/main/CHANGELOG.md#version-100---2026-06-17","sections":[{"kind":"feature","heading":"Added","items":1}],"hash":"955492c926db47de"}],"versions":[{"version":"1.0.0","date":"2026-06-22"},{"version":"0.0.0","date":"2026-06-18","deprecated":"this release was a dummy release and should not be used"}],"crawled_at":"2026-11-15"},"edges":{"maintainers":[{"ref":"actor:cap-js-community","name":"cap-js-community","json":"/actors/cap-js-community.json"}],"contributors":[{"ref":"actor:ashutoshtghorat","name":"ashutoshtghorat","json":"/actors/ashutoshtghorat.json"},{"ref":"actor:bhoomikabedra","name":"Bhoomika","json":"/actors/bhoomikabedra.json"},{"ref":"actor:chgeo","name":"Christian Georgi","json":"/actors/chgeo.json"},{"ref":"actor:hrsthrdy","name":"Harshith Kumar Reddy","json":"/actors/hrsthrdy.json"},{"ref":"actor:ks-prathiksha","name":"KS-Prathiksha","json":"/actors/ks-prathiksha.json"},{"ref":"actor:ksprathiksha","name":"KSPrathiksha","json":"/actors/ksprathiksha.json"},{"ref":"actor:sahumadhusudan","name":"M Sahu","json":"/actors/sahumadhusudan.json"},{"ref":"actor:prathikshaks","name":"PrathikshaKS","json":"/actors/prathikshaks.json"},{"ref":"actor:sjvans","name":"sjvans","json":"/actors/sjvans.json"}],"explained_by":[],"alternative_to_this":[],"needed_by":[],"available_via":[],"parts":[],"add_ons":[],"answered_through_parts":[]}}