Skip to content

baselime/go-opentelemetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Apache 2 License (Apache-2.0).

See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

3 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors

Languages