opencensus-specs icon indicating copy to clipboard operation
opencensus-specs copied to clipboard

Mechanism for adding common tags (e.g. pid, service name, hostname, version)

Open semistrict opened this issue 7 years ago • 3 comments

Moved from: https://github.com/census-instrumentation/opencensus-go/issues/786

This might be solved a number of ways but I wanted to capture the abstract requirement before delving in to the various ways it could be solved now or in future.

It's a common requirement to want to annotate metrics with application-defined tags, that include characteristics of the host/container we are running in, the current binary and configuration etc.

The most straightforward approach for this might be to just add them to the context at a very high level. This would work but unfortunately it would mean that they would be propagated on all outgoing instrumented calls (e.g. all GCP client calls). This is not desired because these tags are only relevant to the current process.

semistrict avatar Jul 16 '18 22:07 semistrict

agreed. this hints at a scoping of tags that isnt request. ex process scope

codefromthecrypt avatar Jul 17 '18 12:07 codefromthecrypt

If I understand the requirement correctly it seems that the library needs to have a notion of process (global) tags which are not part of the "context per request tags" but are available for the stats library (views).

This is similar to this https://github.com/census-instrumentation/opencensus-specs/issues/92

bogdandrutu avatar Jul 17 '18 14:07 bogdandrutu

Would it make sense to implicitly add a set of "process level" tags to to root spans of traces? @ramonza you suggest these tags would be propagated via client calls, what mechanism propagates instrumentation tags to remote RPCs?

tcolgate avatar Jul 25 '18 18:07 tcolgate