Categorygithub.com/baselime/go-opentelemetry
modulepackage
0.1.2
Repository: https://github.com/baselime/go-opentelemetry.git
Documentation: pkg.go.dev

# README

Go Baselime OpenTelemetry SDK

Documentation Latest Release License

Instrument your Go applications with OpenTelemetry and send the traces to Baselime

Getting Started

Check out the documentation.

Example

package main

import (
	"context"
	"log"

	"github.com/baselime/go-opentelemetry"
	"go.opentelemetry.io/otel"
	"go.opentelemetry.io/otel/attribute"
)

var tracer = otel.Tracer("hello-tracer")

func main() {
	params := baselime_opentelemetry.Config{
		ServiceName: "hello-basic",
	}
	otelShutdown, err := baselime_opentelemetry.ConfigureOpenTelemetry(params)

	if err != nil {
		log.Fatalf("error setting up OTel SDK - %e", err)
	}

	defer otelShutdown()
	ctx := context.TODO()
	_, span := tracer.Start(ctx, "hello-span")
	defer span.End()

	span.SetAttributes(
		attribute.String("foo", "bar"),
		attribute.Bool("fizz", true),
	)
}

License

© Baselime Limited, 2023

Distributed under MIT License (The MIT License).

See LICENSE for more information.

# Packages

No description provided by the author

# Functions

No description provided by the author

# Structs

No description provided by the author