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![](/images/permalink.svg)
getFinishedSpans![](/images/permalink.svg)
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![](/images/permalink.svg)
function getMetrics() returns Metrics
Get all the current metrics.
Return Type
- Metrics - Current metrics
Records![](/images/permalink.svg)
observe.mockextension: Counter![](/images/permalink.svg)
Holds counter related metrics data.
Fields
- id MetricId - Id value for counter
- value int - Value
observe.mockextension: Event![](/images/permalink.svg)
Holds the event data.
Fields
- name string - Name of the event
- timestampMicros int - Timestamp value in microseconds
observe.mockextension: Gauge![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
Holds metrics data.
Fields
- counters Counter[] - Counters associated with
- gauges Gauge[] - Gauges associated with
- polledGauges PolledGauge[] - PolledGauges associated with
observe.mockextension: PercentileValue![](/images/permalink.svg)
Holds percentile and value.
Fields
- percentile float - Percentile
- value float - Value
observe.mockextension: PolledGauge![](/images/permalink.svg)
Holds polled gauge related metrics data.
Fields
- id MetricId - Id value for PolledGauge
- value float - Value
observe.mockextension: Snapshot![](/images/permalink.svg)
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![](/images/permalink.svg)
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![](/images/permalink.svg)
Holds the key and value of tag.
Fields
- key string - Key of the tag
- value string - Value of the tag
observe.mockextension: TimeWindow![](/images/permalink.svg)
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: 712594
Current verison: 49274
Weekly downloads