Skip to content

streamingfast/sf-tracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sf-tracing

Setup

export SF_TRACING=<Collector-URL>

Collector-URL

  • stdout://
  • cloudtrace://[host:port]?project_id=<project_id>&ratio=<0.25>
  • zipkin://[host:port]?scheme=<http|https>
  • (http|https)://[host]/[path]?header1=value1&header2=value2
package main

import (
	"context"
	tracing "github.com/streamingfast/sf-tracing"
	"go.opentelemetry.io/otel"
)

func main() {
	ctx := context.Background()

	provider, err := tracing.SetupOpenTelemetry("my-service-name")
	if err != nil {
        panic(err)
    }
	defer provider.Shutdown(ctx)

	myTracer := otel.Tracer("pipeline")

	ctx, span := myTracer.Start(ctx, "something_start")
	defer span.End()

	span.SetAttributes(attribute.Int64("block_num", 1))
	span.AddEvent("something_append")

	span.SetStatus(otelcode.Ok, "")
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages