testing-metrics
v1.0.0
Published
This topic includes instructions on how to send custom metrics to Logz.io from your GO application.
Downloads
3
Readme
This topic includes instructions on how to send custom metrics to Logz.io from your GO application.
The included example uses the OpenTelemetry GO SDK and the OpenTelemetry Cortex exporter, which are both in alpha/preview.
Quick start
Before you begin, you'll need: Node
Add instruments to your application:
Set the variables in the following code snippet:
|Environment variable|Description| |---|---| |url| The Logz.io Listener URL for for your region, configured to use port 8052 for http traffic, or port 8053 for https traffic. | |token| Your Logz.io Prometheus Metrics account token. | |p8s_logzio_name| Label to add to all custom metrics |
Types of metric instruments
For more information, see the OpenTelemetry documentation.
| Name | Behavior | Default aggregation |
| ---- | ---------- | ------------------- |
| Counter | Metric value can only go up or be reset to 0, calculated per counter.Add(context,value,labels)
request. | Sum |
| UpDownCounter | Metric value can arbitrarily increment or decrement, calculated per updowncounter.Add(context,value,labels)
request. | Sum |
| ValueRecorder | Metric values captured by the valuerecorder.Record(context,value,labels)
function, calculated per request. | TBD |
| SumObserver | Metric value can only go up or be reset to 0, calculated per push interval.| Sum |
| UpDownSumObserver | Metric value can arbitrarily increment or decrement, calculated per push interval.| Sum |
| ValueObserver | Metric values captured by the callback function, calculated per push interval.| LastValue |