observe.mockextension
Modules
observe.mockextension
Module observe.mockextension
ballerina/observe.mockextension Ballerina library
Module Overview
This module provides an API for accessing observability mock functionality.
Following functions are provided.
var metrics = mockextension:getMetrics(); var spans = mockextension:getFinishedSpans();
Functions
getFinishedSpans
Get all the finished spans.
Parameters
- serviceName string - The name of the service of which the finished spans should be fetched
Return Type
- Span[] - The finished spans
getMetrics
function getMetrics() returns Metrics
Get all the current metrics.
Return Type
- Metrics - Current metrics
Records
observe.mockextension: Counter
Holds counter related metrics data.
Fields
- id MetricId - Id value for counter
- value int - Value
observe.mockextension: Event
Holds the event data.
Fields
- name string - Name of the event
- timestampMicros int - Timestamp value in microseconds
observe.mockextension: Gauge
Holds gauge related metrics data.
Fields
- id MetricId - Id value for counter
- value float - Value
- count int - Number of occurrences
- sum float - Summation
- snapshots Snapshot[] - Snapshot values
observe.mockextension: MetricId
Holds parameters required to id a metric.
Fields
- name string - Name of the metric
- description string - Description for the metric
- tags Tag[] - Tags included in metric
observe.mockextension: Metrics
Holds metrics data.
Fields
- counters Counter[] - Counters associated with
- gauges Gauge[] - Gauges associated with
- polledGauges PolledGauge[] - PolledGauges associated with
observe.mockextension: PercentileValue
Holds percentile and value.
Fields
- percentile float - Percentile
- value float - Value
observe.mockextension: PolledGauge
Holds polled gauge related metrics data.
Fields
- id MetricId - Id value for PolledGauge
- value float - Value
observe.mockextension: Snapshot
Holds a snapshot of statistics.
Fields
- timeWindow TimeWindow - Time window
- min float - Minimum value
- max float - Maximum value
- mean float - Mean value
- stdDev float - Standard Deviation value
- percentileValues PercentileValue[] - Percentile values
observe.mockextension: Span
Holds the span data.
Fields
- operationName string - Name of the operation
- traceId string - Id for trace
- spanId string - Id for span
- parentId string - Id for parent span
- events Event[] - Event details
observe.mockextension: Tag
Holds the key and value of tag.
Fields
- key string - Key of the tag
- value string - Value of the tag
observe.mockextension: TimeWindow
Holds a time duration.
Fields
- seconds int - Time window in seconds
- nanos int - Time window in nano seconds
Import
import ballerina/observe.mockextension;
Metadata
Released date: over 2 years ago
Version: 1.0.4
Compatibility
Platform: java11
Ballerina version: 2201.0.2
GraalVM compatible: Yes
Pull count
Total: 749916
Current verison: 49298
Weekly downloads