Git Product home page Git Product logo

opencensus-go-exporter-jaeger's Introduction

Warning

OpenCensus and OpenTracing have merged to form OpenTelemetry, which serves as the next major version of OpenCensus and OpenTracing.

OpenTelemetry has now reached feature parity with OpenCensus, with tracing and metrics SDKs available in .NET, Golang, Java, NodeJS, and Python. All OpenCensus Github repositories, except census-instrumentation/opencensus-python, will be archived on July 31st, 2023. We encourage users to migrate to OpenTelemetry by this date.

To help you gradually migrate your instrumentation to OpenTelemetry, bridges are available in Java, Go, Python, and JS. Read the full blog post to learn more.

OpenCensus Go Jaeger Exporter

Build Status GoDoc

Provides OpenCensus exporter support for Jaeger.

Installation

$ go get -u contrib.go.opencensus.io/exporter/jaeger

opencensus-go-exporter-jaeger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

opencensus-go-exporter-jaeger's Issues

Cannot update to latest jaeger client

When trying to update my go deps, I get the following:

# contrib.go.opencensus.io/exporter/jaeger
/go/pkg/mod/contrib.go.opencensus.io/exporter/[email protected]/agent.go:76:10: a.client.SeqId undefined (type *agent.AgentClient has no field or method SeqId)
/go/pkg/mod/contrib.go.opencensus.io/exporter/[email protected]/agent.go:77:30: not enough arguments in call to a.client.EmitBatch
        have (*jaeger.Batch)
        want (context.Context, *jaeger.Batch)
/go/pkg/mod/contrib.go.opencensus.io/exporter/[email protected]/jaeger.go:361:21: not enough arguments in call to obj.Write
        have (*thrift.TBinaryProtocol)
        want (context.Context, thrift.TProtocol)

I have to add the following to keep things happy, but I guess there was a breaking change in the v2.29 update?

replace github.com/uber/jaeger-client-go v2.29.1+incompatible => github.com/uber/jaeger-client-go v2.28.0+incompatible

Goroutine leak

Please answer these questions before submitting a bug report.

What version of the Exporter are you using?

5b8293c

What version of OpenCensus are you using?

7bbec1755a8162b5923fc214a494773a701d506a

What version of Go are you using?

1.11

What did you do?

I am not sure how to reproduce.

What did you expect to see?

Low amount of goroutines.

What did you see instead?

50k+ goroutines.

goroutine profile: total 49263
27310 @ 0x43236f 0x442d29 0x442cff 0x442a9d 0x4764d9 0x474804 0x114618f 0x11466d1 0x4600c1
#	0x442a9c	sync.runtime_SemacquireMutex+0x3c						GOROOT/src/runtime/sema.go:71
#	0x4764d8	sync.(*Mutex).Lock+0x108							GOROOT/src/sync/mutex.go:134
#	0x474803	sync.(*Cond).Wait+0xb3								GOROOT/src/sync/cond.go:57
#	0x114618e	google.golang.org/api/support/bundler.(*Bundler).acquire+0x8e			external/org_golang_google_api/support/bundler/bundler.go:286
#	0x11466d0	google.golang.org/api/support/bundler.(*Bundler).startFlushLocked.func1+0x90	external/org_golang_google_api/support/bundler/bundler.go:271

21851 @ 0x43236f 0x443d19 0x443cef 0x4747ee 0x114618f 0x11466d1 0x4600c1
#	0x443cee	sync.runtime_notifyListWait+0xce						GOROOT/src/runtime/sema.go:510
#	0x4747ed	sync.(*Cond).Wait+0x9d								GOROOT/src/sync/cond.go:56
#	0x114618e	google.golang.org/api/support/bundler.(*Bundler).acquire+0x8e			external/org_golang_google_api/support/bundler/bundler.go:286
#	0x11466d0	google.golang.org/api/support/bundler.(*Bundler).startFlushLocked.func1+0x90	external/org_golang_google_api/support/bundler/bundler.go:271

Additional context

This library is the only one in our binary that usese google.golang.org/api/support/bundler.

This is how we have configured it

       exporter, err := jaeger.NewExporter(jaeger.Options{
		CollectorEndpoint: endpoint,
		Process: jaeger.Process{
			ServiceName: serviceName,
			Tags: []jaeger.Tag{
				jaeger.StringTag("process_name", processName),
				jaeger.StringTag("version", version.GetVersion()),
			},
		},
		BufferMaxCount: 256 * 1e6, // 256Mb
		OnError: func(err error) {
			log.WithError(err).Error("Failed to process span")
		},
	})

Security Policy violation SECURITY.md

This issue was automatically created by Allstar.

Security Policy Violation
Security policy not enabled.
A SECURITY.md file can give users information about what constitutes a vulnerability and how to report one securely so that information about a bug is not publicly visible. Examples of secure reporting methods include using an issue tracker with private issue support, or encrypted email with a published key.

To fix this, add a SECURITY.md file that explains how to handle vulnerabilities found in your repository. Go to https://github.com/census-ecosystem/opencensus-go-exporter-jaeger/security/policy to enable.

For more information, see https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository.


This issue will auto resolve when the policy is in compliance.

Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.

If the invocation interval between trace.StartSpan and span.End() is too small,I can't find my service registered in jaeger on Jaeger UI

problem

my code is come from quickstart
I replace openzipkin with jaeger:

package main

import (
	"bytes"
	"context"
	"encoding/binary"
	"fmt"
	"log"
	"time"

	"contrib.go.opencensus.io/exporter/jaeger"
	"go.opencensus.io/trace"
)

func main() {
	//// 1. Configure exporter to export traces to Zipkin.
	//localEndpoint, err := openzipkin.NewEndpoint("go-quickstart", "192.168.1.5:5454")
	//if err != nil {
	//	log.Fatalf("Failed to create the local zipkinEndpoint: %v", err)
	//}
	//reporter := zipkinHTTP.NewReporter("http://localhost:9411/api/v2/spans")
	//ze := zipkin.NewExporter(reporter, localEndpoint)
	//trace.RegisterExporter(ze)
	//
	//// 2. Configure 100% sample rate, otherwise, few traces will be sampled.
	//trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})

	agentEndpointURI := "http://localhost:6831"
	collectorEndpointURI := "http://localhost/api/traces"

	je, err := jaeger.NewExporter(jaeger.Options{
		AgentEndpoint:     agentEndpointURI,
		CollectorEndpoint: collectorEndpointURI,
		ServiceName:       "demo",
	})
	if err != nil {
		log.Fatalf("Failed to create the Jaeger exporter: %v", err)
	}

	// 3. Create a span with the background context, making this the parent span.
	// A span must be closed.
	ctx, span := trace.StartSpan(context.Background(), "main")
	// 5b. Make the span close at the end of this function.
	defer span.End()

	for i := 0; i < 10; i++ {
		doWork(ctx)
	}
}

func doWork(ctx context.Context) {
	// 4. Start a child span. This will be a child span because we've passed
	// the parent span's ctx.
	_, span := trace.StartSpan(ctx, "doWork")
	// 5a. Make the span close at the end of this function.
	defer span.End()

	fmt.Println("doing busy work")
	time.Sleep(80 * time.Millisecond)
	buf := bytes.NewBuffer([]byte{0xFF, 0x00, 0x00, 0x00})
	num, err := binary.ReadVarint(buf)
	if err != nil {
		// 6. Set status upon error
		span.SetStatus(trace.Status{
			Code:    trace.StatusCodeUnknown,
			Message: err.Error(),
		})
	}

	// 7. Annotate our span to capture metadata about our operation
	span.Annotate([]trace.Attribute{
		trace.Int64Attribute("bytes to int", num),
	}, "Invoking doWork")
	time.Sleep(20 * time.Millisecond)
}

when I run my program and access port 16686 of the Jaeger UI,I can't find my service registered in jaeger on the Jaeger UI

solution

just replace "time.Sleep(20 * time.Millisecond)" with "time.Sleep(time.Second)"

why is that?

MessageEvents are not propagated?

Please answer these questions before submitting a bug report.

What version of the Exporter are you using?

commit 5b8293c

What version of OpenCensus are you using?

commit 7bbec1755a8162b5923fc214a494773a701d506a

What version of Go are you using?

go 1.13

What did you do?

If possible, provide a recipe for reproducing the error.

// On sending side
span.AddMessageSendEvent(id, n, n)
// On receiving side
span.AddMessageReceiveEvent(id, n, n)

What did you expect to see?

Messages linked in jaeger

What did you see instead?

Nothing.

Additional context

See how stackdriver exports these events: https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/4351271b777d160d27010a22de3e41fd07335556/trace_proto.go#L121

Jaeger propagator

NB: Before opening a feature request against this repo, consider whether the feature should/could be implemented in exporter libraries in other languages. If so, please open an issue on opencensus-specs first.

Is your feature request related to a problem? Please describe.
For my application I need to connect with Jaeger traces that are incoming. Therefore I need to do a propagation with the correct header and the Jaeger header format.

Describe the solution you'd like
My solution is to do it in the same way as the stackdriver exporter does it. https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/tree/master/propagation

The stackdriver exporter implements the HttpFormat of opentracing and returns a SpanContext with the remote tracingID.

Describe alternatives you've considered
I have not found any alternative with opencensus in order to connect existing traces of a remote.

Additional context
I will open a pull request which successfully works with a traefik setup adding a trace to the backend. See screenshot below:
image

Release new version

Can you please release new version (0.2.0) with latest code?
Current latest release doesn't contain jaeger propagator.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.