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

Support for common attributes/tags for tracer

Open ghost opened this issue 7 years ago • 3 comments

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

0.18

What JVM are you using (java -version)?

1.8

What did you do?

We are looking to use opencensus-java for tracing. How do you add tags to spans/traces? We want to have atleast have a common set of tags associated with every trace such as environment, datacenter etc I saw there are addAnnotation or putAttribute on a span level. Was wondering if there was something to add tags/attributes on startup to the tracer so that all spans/traces get some common tags such as datacenter, environment etc

ghost avatar Dec 06 '18 17:12 ghost

Is there any answer to this question?

It seems like a valid question, especially with respect to stats. The library should provide an easy way to set common tags that should be reported with all metrics. Is this planned or is there any possible workaround for making this possible?

ivansenic avatar Dec 24 '18 14:12 ivansenic

Hi all,

We are moving forward with adding the capability at the exporter level. What exporter do you want to use?

bogdandrutu avatar Jan 25 '19 21:01 bogdandrutu

Hi all,

We are moving forward with adding the capability at the exporter level. What exporter do you want to use?

Prometheus.

But shouldn't this be something that is not directly bound to the exporter? If I decide to switch the exporter at some point, I would like to have a minimal amount of changes. I believe this is something that should be part of the API and then, of course, each exporter implementation can handle this in its own way.

ivansenic avatar Jan 28 '19 07:01 ivansenic