Comments (3)
The proposed signature precludes the user from adding their own labels to the profiler, which would be annoying. At least calls to pprof.Do() are nestable, so I could call it twice, once for the tag map, then once for my labels, but that feels clunky.
A signature of
func Do(ctx context.Context, m *Map, l *pprof.LabelSet, f func(c context.Context)) or
func Do(ctx context.Context, m *Map, f func(c context.Context), l ...pprof.LabelSet)
might be more helpful to the user, with a clearly defined behavior that keys in the tag map clobber user-provided keys (for example). The downside of this suggestion is that the collision behavior for identical keys is baked into Do, whereas with the previous approach, calls to Do determine the collision behavior.
Alternatively, if the runtime/pprof API could be modified to include a capability to merge LabelSets into a single LabelSet, that'd be powerful. LabelSets are opaque in the same way tag maps are, so a function to convert tag maps to a LabelSet would be sufficient while retaining the opacity properties of the tag map.
I have a somewhat pressing need for this functionality, and would be delighted to contribute if it can help expedite its existence, hence the thoughts exploring the potential design spaces.
from opencensus-go.
I haven't done a very comprehensive survey but the mutual use of pprof labels with tags was not that common. That's the main reason the suggested API is opinionated to work against the tags but we need to make the mutual use possible.
@matloob, this case seems to be a very common use case for instrumentation libraries. What do we suggest them to do? I also don't have a good background how the standard library pprof labels APIs have been emerged. In Do
, we don't want to apply profiler labels from the incoming context automatically. Is this to avoid user having to write one more line (pprof.WithLabels) or we want them to avoid passing a context with lots of profiler labels around?
from opencensus-go.
I think tag.Do is exactly what we need.
from opencensus-go.
Related Issues (20)
- Remove rakyll from being an auto-assignee for reviews HOT 3
- metric: document how to use the Registry and export metrics out HOT 1
- Test_Worker_MultiExport intermittently fails: Mismatched value
- Defining stats and views for dynamically created endpoints HOT 4
- stats: defaultWorker can not be stopped HOT 1
- [ochttp] KeyClientHost tag doesn't change in exported Prometheus metrics
- compile error HOT 1
- Improve performance of stats recording HOT 6
- Tracestate header not generated or mutated
- race condition inside opencensus ochttp when used inside google storage API
- ProbabilitySampler always sample when incoming trace-id is 64-bit (B3/Jaeger)
- Span name with stack trace
- Tag has concurrent access problem
- Is there a function or way to transfor `view.Data` to `WriteRequest` HOT 2
- Testify needs updating due to DOS and Null ptr dereference - plz update testify to >= 1.7.5
- Security issue: recording query params insecure (tokens) HOT 7
- Panic when running stats.Record without importing the view package
- ochttp.Handler.ServeHTTP func param r * http.Request did not modify r.MultipartForm correctly HOT 3
- Hash pin github workflow dependencies
- Memory statistics never collected unless UseDerivedCumulative is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencensus-go.