GithubHelp home page GithubHelp logo

gls's People

Contributors

flimzy avatar jtolio avatar riannucci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gls's Issues

Not working at Go tip

gls currently does not work at Go tip - it appears to have broken somewhere between 1.11.2 and golang/go@78c0e1f.

This means that the goconvey package doesn't work any more, since it relies on gls for context tracking.

Test code:

package main

import (
	"fmt"
	"runtime"

	"github.com/jtolds/gls"
)

func main() {
	fmt.Printf("Go version: %s\n", runtime.Version())
	manager := gls.NewContextManager()

	manager.SetValues(gls.Values{
		"foo": 1,
	}, func() {
		foo, ok := manager.GetValue("foo")
		fmt.Printf("foo, ok = %+v, %t\n", foo, ok)
	})
}

Output on recent versions:

Go version: go1.11.1
foo, ok = 1, true
Go version: go1.11.2
foo, ok = 1, true
Go version: devel +78c0e1f Fri Nov 9 19:57:57 2018 +0000
foo, ok = <nil>, false

[Question] Looking for Context propagation mechanism for Apache SkyWalking golang sdk

Hi @jtolds , glad to find these cool codes. I am the original creator and current PPMC, committer of Apache SkyWalking (incubating) project: https://github.com/apache/incubator-skywalking

I am a rookie and new for golang ecosystem, and aware of building an auto-instrument(I prefer most) is possible but hard. So the first step is providing a manual instrument sdk based on SkyWalking model, like you did in monkit-zipkin.

So I definitely look for the thread local propagation for matching our tracing context : https://github.com/apache/incubator-skywalking/blob/master/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextManager.java#L46 I assume the gls library can do that? Am I right?

And also, I found your spacemonkeygo/monkit library, but look like it is more likely based on a pure manual context propagation. Do I get the point right?

I hope you can have time to help with our Apache project.

Usage match

Hey, I'm not sure if you're still interested in this library, but I was wondering if you could answer a question for me. My use case is similar to the second one mentioned in the read me. I'd like to find a way to identify an HTTP request context for metric purposes. Rather than passing around a context I'd like to consider a goroutine as the context so I can work out timing information on a per request basis.

Would your library work for this, or is it a bit of overkill since I'm really only interested in having an identifier for each goroutine (and possibly looking up the goroutine hierarchy to see if an ancestor is a known goroutine).

please tag and version this project

Hello,

Can you please tag and version this project?

I am the Debian Maintainer for gls and versioning would help Debian keep up with development.

SetValues breaks in Go 1.12

A simple example below. GetValue should return 0, true, but in Go 1.12, it returns 0, false.

package main

import (
	"fmt"

	"github.com/jtolds/gls"
)

func main() {
	mgr := gls.NewContextManager()
	mgr.SetValues(gls.Values{"node": 1}, func() {
		fmt.Println(mgr.GetValue("node"))
	})
}

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.