GithubHelp home page GithubHelp logo

Comments (13)

yurishkuro avatar yurishkuro commented on June 6, 2024

do you have it written already? I'd be curious to see it first, just as a paste.

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

Nothing special really:

// kitLogger wraps the application logger instance in a Jaeger compatible one.
type kitLogger struct {
	logger log.Logger
}

// Error implements the github.com/uber/jaeger-client-go/log.Logger interface.
func (l *kitLogger) Error(msg string) {
	level.Error(l.logger).Log("msg", msg)
}

// Infof implements the github.com/uber/jaeger-client-go/log.Logger interface.
func (l *kitLogger) Infof(msg string, args ...interface{}) {
	level.Info(l.logger).Log("msg", fmt.Sprintf(msg, args...))
}

Needs a constructor and exporting a few bits. It would probably make sense to call level.* once and store the two leveled loggers.

Another feature could be changing the message key, as in case of the go-kit stdlog wrapper.

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

Thanks. I wonder if it could be added simply as a recipe somewhere in the docs rather than part of the library, because it can't compile without requiring a dependency on go-kit. Or a separate small repo, like jaegertracing/go-client-gokit

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

Fine by me. Though the jaeger-lib package already requires the go-kit package for metrics stuff.

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

@sagikazarmark that's true, but if you look at glide.lock, the only thing that gets directly imported into the client is this:

- name: github.com/uber/jaeger-lib
  version: 575c678b2873b62aaadd0fa5817a2aeb3155dc4d
  subpackages:
  - metrics
  - metrics/testutils

The go-kit is not imported unless the end-user project wants to use its bindings.

My suggestion is to put your code into a github gist and submit a PR to this project with an update to README mentioning that there's the binding for go-kit.

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

Which do you think would be better? A gist or a separate repo.

While I'm all for copying small amount of code which just works and never needs to be modified, one would prefer an installable package. A repo would let the user choose (copy/install) and we could write tests (even if that doesn't add much).

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

another option is to put this into jaeger-lib, e.g. in client/log/gokit

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

yes, please

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

Done, see PR above.

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

once that PR is merged, we should make an entry in the README here

from jaeger-client-go.

sagikazarmark avatar sagikazarmark commented on June 6, 2024

Should I add a note in the readme?

from jaeger-client-go.

yurishkuro avatar yurishkuro commented on June 6, 2024

yes please

from jaeger-client-go.

Related Issues (20)

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.