• Stars
    star
    119
  • Rank 297,930 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🚀 Go Distributed Tracing & Metrics Sensor for Instana

Instana Go Collector

Instana, an IBM company

Build Status PkgGoDev OpenTracing Go Report Card

The Go Collector is a runtime metrics collector, code execution tracer and profiler for applications and services written in Go. This module is a part of Instana APM solution.

Dependency

  • Since version 1.47 the Go Collector requires Go version 1.13 or later.
  • Since version 1.53.0, the Go Collector uses fsm v1.0.1 internally. Customers using fsm version prior to v1 in their projects may face compilation issues and will need to update the fsm version to v1.

Installation

To add Instana Go Collector to your service run:

$ go get github.com/instana/go-sensor

You might also consider installing supplemental modules that provide instrumentation for most popular 3rd-party packages.

Please refer to Instana Go Collector documentation for further details on how to activate Go Collector and use it to instrument your application code.

Configuration

The Go Collector accepts both configuration from within the application code and via environment variables. The values provided via enironment variables take precedence. In case is no specific configuration provided, the values returned by instana.DefaultOptions() will be used.

Please refer to Go Collector Configuration page for detailed instructions. There is also the Go Collector How To page that covers the most common configuration use cases.

Usage

In order to trace the code execution, a few minor changes to your app's source code is needed. Please check the examples section and the Go Collector How To guide to learn about common instrumentation patterns.

Features

Runtime metrics collection

Once initialized, the Go Collector starts automatically collecting and sending the following runtime metrics to Instana in background:

  • Memory usage
  • Heap usage
  • GC activity
  • Goroutines

Code execution tracing

Instana Go Collector provides an API to instrument function and method calls from within the application code to trace its execution.

The core github.com/instana/go-sensor package is shipped with instrumentation wrappers for the standard library, including HTTP client and server, as well as SQL database drivers compatible with database/sql. There are also supplemental instrumentation modules provide code wrappers to instrument the most popular 3rd-party libraries.

Please check the examples section and the Go Collector How To guide to learn about common instrumentation patterns.

OpenTracing

Instana Go Collector provides an interface compatible with github.com/opentracing/opentracing-go and thus can be used as a global tracer. However, the recommended approach is to use the Instana wrapper packages/functions provided in the library. They set up a lot of semantic information which helps Instana get the best picture of the application possible. Sending proper tags is especially important when it comes to correlating calls to infrastructure and since they are strings mostly, there is a large room for making a mistake.

The Go Collector will remap OpenTracing HTTP headers into Instana headers, so parallel use with some other OpenTracing model is not possible. The Instana tracer is based on the OpenTracing Go basictracer with necessary modifications to map to the Instana tracing model.

Trace continuation and propagation

Instana Go Collector ensures that application trace context will continued and propagated beyond the service boundaries using various methods, depending on the technology being used. Alongside with Instana-specific HTTP headers or message attributes, a number of open standards are supported, such as W3C Trace Context and OpenTelemetry.

W3C Trace Context & OpenTelemetry

The instrumentation wrappers provided with Go Collector automatically inject and extract trace context provided via W3C Trace Context HTTP headers.

Continuous profiling

Instana AutoProfile™ generates and reports process profiles to Instana. Unlike development-time and on-demand profilers, where a user must manually initiate profiling, AutoProfile™ automatically schedules and continuously performs profiling appropriate for critical production environments.

Please refer to the Instana Go Collector docs to learn how to activate and use continuous profiling for your applications and services.

Sending custom events

The Go Collector, be it instantiated explicitly or implicitly through the tracer, provides a simple wrapper API to send events to Instana as described in its documentation.

To learn more, see the Events API document in this repository.

Examples

Following examples are included in the example folder:

  • Greeter - an instrumented HTTP server that queries a database
  • Doubler - an instrumented Kafka processor, that consumes and produces messages
  • Event - Demonstrates usage of the Events API
  • Autoprofile - Demonstrates usage of the AutoProfile™
  • OpenTracing - an example of usage of Instana tracer in an app instrumented with OpenTracing
  • gRPC - an example of usage of Instana tracer in an app instrumented with gRPC
  • Gin - an example of usage of Instana tracer instrumenting a Gin application
  • httprouter - an example of usage of Instana tracer instrumenting a github.com/julienschmidt/httprouter router

For more examples please consult the godoc and the Go Collector How To page.

Filing Issues

If something is not working as expected or you have a question, instead of opening an issue in this repository, please open a ticket at Instana Support portal instead.

More Repositories

1

robot-shop

Sample microservices application for playing with
JavaScript
860
star
2

nodejs

Node.js in-process collectors for Instana
JavaScript
69
star
3

python-sensor

🐍 Python Distributed Tracing & Metrics Sensor for Instana
Python
68
star
4

instana-agent-operator

A Kubernetes operator to install and manage the Instana agent.
Go
45
star
5

weasel

Gather end-user browser performance data
JavaScript
40
star
6

instana-grafana-datasource

🔭 Grafana datasource plugin for Instana
TypeScript
38
star
7

ruby-sensor

💎 Ruby Distributed Tracing & Metrics Sensor for Instana
Ruby
26
star
8

instana-java-opentracing

Instana Java OpenTracing
Java
20
star
9

android-agent

Gather end-user Android app performance data
Kotlin
19
star
10

iOSAgent

Swift
18
star
11

agent-updates

Public Reference Repository for Instana Agent Updates
18
star
12

otel-shop

OpenTelemetry Demo App
JavaScript
17
star
13

crystal-sensor

🔮 Crystal Distributed Tracing & Metrics Sensor for Instana
Crystal
16
star
14

nginx-tracing

Instana tracing for NGINX demonstration
Java
12
star
15

instana-agent-ansible

Ansible role to install instana-agent
Ruby
11
star
16

otel-dc

Java
10
star
17

helm-charts

Curated applications for Kubernetes
Mustache
10
star
18

instana-java-sdk

Open Source Repository for the Instana Java SDK
Java
10
star
19

envoy-tracing

Deprecated demo of Instana's tracing for Envoy Proxy (1.15..1.29) based on OpenTracing
Java
10
star
20

website-monitoring-examples

How to make use of website monitoring APIs
7
star
21

instana-autotrace-webhook

Mustache
7
star
22

instana-agent-docker

Shell
6
star
23

self-hosted-k8s

Documentation and templates for hosting instana using the operator
Shell
5
star
24

synthetic-synctl

CLI Tool for Synthetic Monitoring to Manage Synthetic Test and Locations Easily
Python
5
star
25

openapi

Contains the instana public api documentation for publish on gh-pages.
JavaScript
5
star
26

flutter-agent

Dart
5
star
27

instana-ansible

Collection of things for integration with Ansible
Python
4
star
28

onprem-distkit

A collection of configurations that may be useful for operators of distributed Instana deployments
Shell
4
star
29

instana-php-opentracing

PHP
4
star
30

react-native-agent

Monitor React Native app end-user interactions with Instana
Java
4
star
31

instana-javaagent

javaagent to initialize JVM attach and instrumentation APIs at JVM startup.
Java
4
star
32

synthetic-api-script

Command script-cli to run/debug Synthetic API Script
JavaScript
4
star
33

github-action-update-agent-configurations

Shell
3
star
34

trace-context.js

JavaScript Parser / serializer for the formats defined in the W3C TraceContext specification
TypeScript
3
star
35

lab-self-hosting-k8s

Tools and docs that help launch self-hosted Instana extremely easy.
Shell
3
star
36

haskell-trace-sdk

Haskell
3
star
37

instana-nodejs-demos

JavaScript
3
star
38

ingress-nginx-tracing

Obsolete: Instana Init Containers to provide Distributed Tracing to Kubernetes NGINX Ingress
3
star
39

agent-k8s-deployment

3
star
40

pipeline-feedback-orb

Shell
2
star
41

gitops-demo

Shell
2
star
42

instana-dotnetcore-sdk-examples

C#
2
star
43

envcheck

Go
2
star
44

android-agent-examples

Java
2
star
45

envoy-otel-tracing

Demo of Instana's tracing for Envoy Proxy (1.30..latest) based on OpenTelemetry
Java
2
star
46

monitoring-presentation

A presentation showing a tiny sample app for monitoring demo purposes at universities
JavaScript
1
star
47

ui-notifications

Maintenance and release notes which will be published in the UI
Shell
1
star
48

archer

a stop gap rpm/deb installer/updater toolkit
Go
1
star
49

instana-openapi-golang-example

Go
1
star
50

ibm-monitoring-integration

Deployment package for the IBM Monitoring Instana Integration service.
1
star
51

pipeline-feedback-resource

Shell
1
star
52

instana-dotnet-sdk-examples

Open Source Repository for the Instana .Net SDK
C#
1
star
53

instana-php-sdk

PHP
1
star
54

ibm-instana-ansible

A repository of ansible artifacts for Instana
Python
1
star
55

terraform-provider-instana

Terraform provider implementation for Instana REST API
Go
1
star
56

synthetic-browser-script

JavaScript
1
star
57

instana-idea-php-plugin

Java
1
star
58

agent-google-market-app

Instana Agent app on Google Marketplace
Mustache
1
star
59

instana-version-resource

A simple Concourse CI action to keep track of the latest Instana version, SaaS or self-managed.
Shell
1
star
60

self-hosted-backup-restore

Blueprint for Instana Self-Hosted Custom Edition backup and restore
Shell
1
star