basic

command module
v0.0.0-...-34973f1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Basic sample to configure and use Dynatrace OpenTelemetry exporter

The sample will write a single value to otel.dynatrace.com.golang metric. By default, the sample will connect to the local OneAgent endpoint.

To send metric directly to Dynatrace server metric ingest, set environment variables ENDPOINTand API_TOKEN.

$ # Export to local OneAgent endpoint
$ ./go run main.go
2021-07-15T12:22:41.487-0400    INFO    basic/main.go:58        Using local OneAgent API
2021/07/15 12:22:41 Could not read OneAgent metadata. This is normal if no OneAgent is installed, or if you are running this on Linux.
2021-07-15T12:22:41.487-0400    DEBUG   dynatrace/dynatrace.go:221      Sending lines to Dynatrace
otel.dynatrace.com.golang,dt.metrics.source=opentelemetry gauge,min=1,max=1,sum=1,count=1
2021-07-15T12:22:41.923-0400    DEBUG   dynatrace/dynatrace.go:246      Exported 1 lines to Dynatrace

$ # Export directly to Dynatrace server
$ ENDPOINT=https://<Environment ID>.live.dynatrace.com/api/v2/metrics/ingest API_TOKEN=<API Token> go run main.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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