-
Notifications
You must be signed in to change notification settings - Fork 63
Add metric labels and trace attributes to stackdriver exporter #537
Conversation
Signed-off-by: Brian Akins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bakins, thanks for submitting this PR.
We've been using general mechanisms like global-tags instead of exporter specific ones, do they not work in your scenario?
EnableTracing bool `mapstructure:"enable_tracing,omitempty"` | ||
EnableMetrics bool `mapstructure:"enable_metrics,omitempty"` | ||
MetricPrefix string `mapstructure:"metric_prefix,omitempty"` | ||
TraceAttributes map[string]interface{} `mapstructure:"trace_attributes,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not use global tags instead? In general we've been approaching this type of issue making it happen in the oc proto format so all exporters can generate the same data.
We still don't have the same for metric labels and prefix but both are applicable too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That URL 404's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ops, just fixed the link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have links for other docs, that'd be great. My searching came up empty. If I can use an existing feature, I'd rather do so. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now we just have global tags for tracing https://github.com/census-instrumentation/opencensus-service#-global-tags but we should implement the equivalent for metrics /cc @songy23
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, there is an issue regarding naming: on OC we should refer to these as attributes instead of tags but the docs were not updated yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another related feature for attributes is in the pipelines #536
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #537 +/- ##
==========================================
+ Coverage 59.1% 59.59% +0.48%
==========================================
Files 69 69
Lines 4519 4524 +5
==========================================
+ Hits 2671 2696 +25
+ Misses 1682 1657 -25
- Partials 166 171 +5
Continue to review full report at Codecov.
|
@bakins I'm closing this PR, let's know if you still want to move ahead with it. |
I missed the notification for this. Sorry about that. #536 looks good for spans, I'd like something like that for metrics as well. I can take a look unless it is already in progress. |
Add ability to set trace attributes and metric labels as described in https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/blob/master/stackdriver.go#L210-L228
We set these when using Stackdriver exporter directly in our applications to set pod, namespace, etc inside Kubernetes.
Should also allow one to add labels to address #519