Metrics
- Print
Metrics
- Print
Article summary
Did you find this summary helpful?
Thank you for your feedback
title: Metrics
version: 1.0.0
layout: default
sdk: manage
# Metrics Module
Version Metrics 1.0.0
Table of Contents
Usage
To use the Metrics module, you can import it into your project from the Firebolt SDK:
import { Metrics } from '@firebolt-js/manage-sdk'
Overview
Methods for sending metrics
Methods
event
Inform the platform of 1st party distributor metrics.
function event(schema: string, data: EventObject): Promise<null>
Parameters:
Param | Type | Required | Description |
---|---|---|---|
schema | string | true | The schema URI of the metric type format: uri |
, | data | EventObject | true |
Promise resolution:
null
Capabilities:
Role | Capability |
---|---|
uses | xrn:firebolt:capability:metrics:distributor |
Examples
Send foo event
JavaScript:
import { Metrics } from '@firebolt-js/manage-sdk'
Metrics.event("http://meta.rdkcentral.com/some/schema", {"foo":"foo"})
.then(results => {
console.log(results)
})
Value of results
:
null
JSON-RPC:
Request:{
"jsonrpc": "2.0",
"id": 1,
"method": "Metrics.event",
"params": {
"schema": "http://meta.rdkcentral.com/some/schema",
"data": {
"foo": "foo"
}
}
}
Response:
{
"jsonrpc": "2.0",
"id": 1,
"result": null
}
Types
EventObjectPrimitives
type EventObjectPrimitives = string | number | number | boolean | null
EventObject
type EventObject = {
[property: string]: EventObjectPrimitives | EventObjectPrimitives | EventObject[] | EventObject
}
See also:
string | number | number | boolean | null
EventObject
Was this article helpful?