The APM OpenTelemetry Collector is part of the Riverbed Platform and can collect OTLP, the OpenTelemetry native telemetry protocols, as well as Jaeger and Zipkin telemetry.
In this cookbook, the APM collects the telemetry of a Go webapp that is instrumented using the OpenTelemetry SDK. It can export OpenTelemetry, Jaeger, or Zipkin telemetry. The APM OpenTelemetry Collector container is deployed next to the web app. It collects every trace - no sampling.
- an APM account (SaaS)
- a Docker host, for example Docker Desktop
Navigate to APM (for example https://apm.myaccount.aternity.com) > Agents > Install Agents:
- Find your CustomerID, for example 12341234-12341234-13241234
- Grab SaaS Analysis Server Host, for example agents.apm.myaccount.aternity.com
This information are required to activate the APM OpenTelemetry Collector container, passing via the environment variable SERVER_URL
.
-
Clone this repository.
-
Start the containers using the docker-compose.yaml, for example with Bash:
cd Riverbed-Community-Toolkit/APM/105-opentelemetry-go-app # Configure the environment variables for the APM OpenTelemetry Collector export ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com" export ATERNITY_CUSTOMER_ID="12341234-12341234-13241234" docker-compose up
or with PowerShell:
cd Riverbed-Community-Toolkit/APM/105-opentelemetry-go-app # Configure the environement variable for the APM OpenTelemetry Collector $env:ATERNITY_SAAS_SERVER_HOST="agents.apm.myaccount.aternity.com" $env:ATERNITY_CUSTOMER_ID="12341234-12341234-13241234" docker-compose up
There is an in-built load generator in the docker-compose
startup. If you want to manually add traffic, http://localhost:8081/ from a browser or call the url from a command line.
curl http://localhost:8081/
Search transaction, browse the spans for the selected transaction :
View details of a specific transaction as a waterfall chart :
Press CTRL + C in the shell where it is running.
Or in a shell, go to the folder where you keep the docker-compose.yaml and run:
docker-compose down
The cookbook contains few files:
- main.go is the common start to the 2 distributed services -
frontend
&backend
. - tracer.go is the OpenTelemetry SDK setup for multiple exporters (OpenTelemetry, Jaeger, Zipkin, file), and the B3 context propagation.
- Dockerfile defines the docker image to build
- docker-compose.yaml is the main file that defines the multi-tier app with 4 services:
- the instrumented 2-tier Go
frontend
web app - the instrumented 2-tier Go
backend
web app - the APM OpenTelemetry Collector
- the load generator
- the instrumented 2-tier Go
This example can also be executed on a K8s cluster.
Steps:
% <edit kubernetes/aternity-collector.yml
with your Aternity SaaS Analysis Server host & customer id>
% kubectl apply -f kubernetes/
Copyright (c) 2022 Aternity. The contents provided here are licensed under the terms and conditions of the MIT License accompanying the software ("License"). The scripts are distributed "AS IS" as set forth in the License. The script also include certain third party code. All such third party code is also distributed "AS IS" and is licensed by the respective copyright holders under the applicable terms and conditions (including, without limitation, warranty and liability disclaimers) identified in the license notices accompanying the software.