Loading

Golang Integration

<div class="condensed-table">
| | |
| --- | --- |
| Version | 1.6.1 (View all) |
| Compatible Kibana version(s) | 8.13.0 or higher |
| Supported Serverless project types
What’s this? | Security
Observability |
| Subscription level
What’s this? | Basic |
| Level of support
What’s this? | Elastic |

</div>

The Golang integration allows you to monitor a Golang application. Go is a statically typed, compiled programming language designed at Google. It is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency. It is often referred to as Golang.

Use the Golang integration to:

  • Gain insights into expvar and heap statistics.
  • Create visualizations to monitor, measure and analyze the state of heap, garbage collector, memory, mcache structures, mspan structures etc.

The Golang integration collects metrics using expvar package. Metrics are exported on "/debug/vars" endpoint after importing expvar package and adding an HTTP handler.

Metrics help you keep a record of the state of the Go (Golang) application. Metric data streams collected by the Golang integration include expvar and heap.

Data streams:

  • heap: Collects heap metrics like heap allocation and garbage collection metrics.
  • expvar: Collects metrics like memstats, cmdline and custom (user-defined) metrics.

Note:

  • Users can monitor and see the metrics inside the ingested documents for Golang in the logs-* index pattern from Discover.

This integration has been tested against Golang versions 1.19 and 1.18.

You need Elasticsearch for storing and searching your data and Kibana for visualizing and managing it. You can use our hosted Elasticsearch Service on Elastic Cloud, which is recommended or self-manage the Elastic Stack on your own hardware.

For step-by-step instructions on how to set up an integration, see the Getting started guide.

  • If host.ip appears conflicted under the logs-* data view, this issue can be resolved by reindexing the Heap and Expvar data streams.

This is the expvar data stream. Metrics of garbage collector, mcache structures and mspan structures can be collected using expvar data stream. Custom metrics can also be collected under golang.expvar.custom field.

ECS Field Reference

Please refer to the following document for detailed information on ECS fields.

This is the heap data stream. Metrics like heap allocations and GC pause can be collected using heap data stream.

ECS Field Reference

Please refer to the following document for detailed information on ECS fields.