Syn3rman / otel

Demo otel app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OTel demo app

This repo contains a basic example to set up tracing in your go application using OpenTelemetry. Additionally, we also use the prometheus client library to collect metrics from our application, which can be visualized using Grafana. We can optionally create a custom build of the OpenTelemetry Collector using the prometheus receiver from the collector contrib repo and configure a pipeline for metrics of the form

receivers:
	prometheus
	
processors:
	any processor

exporters:
	any supported exporter

Running the example

To run the demo, you just need to clone the repo to your machine, navigate into the directory, and run:

$ docker-compose up

Now, you can navigate to localhost and view the trace data generated in the console. The metrics can also be viewed on the /metrics endpoint. A grafana instance will also be started at port 3000 with admin as username and password, so you can now login to it and add prometheus as a data source to visualize metrics.

You can also find the go application under the src directory, so you can choose to execute it to see the logs generated by the stdout exporter in case you do not have docker-compose installed on your system.

Expected output:

Console output


stdout

Grafana


grafana

About

Demo otel app


Languages

Language:Go 92.1%Language:Dockerfile 7.9%