example

command module
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

Example

This example instruments a simple HTTP server-client application.

The application is configured to send spans and metrics to a local instance of the OpenTelemetry Collector, which propagates them to Splunk Observability Cloud.

Prerequisites

Usage

Run the OpenTelemetry Collector and Jaeger instance:

SPLUNK_ACCESS_TOKEN=<access_token> docker-compose up

The value for SPLUNK_ACCESS_TOKEN can be found here. Reference: docs.

Run the instrumented application:

export OTEL_SERVICE_NAME="splunk-otel-go-example"
export OTEL_RESOURCE_ATTRIBUTES="deployment.environment=$(whoami)"
export OTEL_METRICS_EXPORTER="otlp"
go run .

You can find the collected telemetry in:

Cleanup:

docker-compose down

Documentation

Overview

Package example instruments a simple HTTP server-client application.

The application is configured to send spans to a local instance of the OpenTelemetry Collector, which propagates them to both Splunk Observability Cloud and to a local Jaeger instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL