-
Notifications
You must be signed in to change notification settings - Fork 288
Conversation
588c755
to
6163718
Compare
Codecov Report
@@ Coverage Diff @@
## master #222 +/- ##
==========================================
- Coverage 81.99% 81.74% -0.25%
==========================================
Files 51 51
Lines 3226 3226
==========================================
- Hits 2645 2637 -8
- Misses 457 464 +7
- Partials 124 125 +1
Continue to review full report at Codecov.
|
encounter with |
README.md
Outdated
stats := // create StatsReporter implementation | ||
tracer := config.Tracing.New("your-service-name", stats) | ||
import ( | ||
"github.com/prometheus/client_golang/prometheus" |
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.
spacing is funky
HTTP Header `jaeger-baggage` on a request | ||
The OpenTracing spec allows for [baggage][baggage], which are key value pairs that are added | ||
to the span context and propagated throughout the trace. An external process can inject baggage | ||
by setting the special HTTP Header `jaeger-baggage` on a request: |
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.
we should have a TODO to update documentation so that users are aware of https://github.com/jaegertracing/jaeger-client-go/blob/master/header.go#L30
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.
metrics.go
Outdated
@@ -33,16 +33,16 @@ type Metrics struct { | |||
TracesJoinedNotSampled metrics.Counter `metric:"traces" tags:"state=joined,sampled=n"` | |||
|
|||
// Number of sampled spans started by this tracer | |||
SpansStarted metrics.Counter `metric:"spans" tags:"group=lifecycle,state=started"` | |||
SpansStarted metrics.Counter `metric:"spans-by-lifecycle" tags:"state=started"` |
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.
how bout "spans-lifecycle"
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.
I'm open to suggestions how to make the naming more consistent across the board.
One other thing I would like to do is to use underscore instead of dash as a separator. Dash is not valid in Prometheus.
b61406c
to
95314c3
Compare
@black-adder please take a look at the new naming https://github.com/jaegertracing/jaeger-client-go/pull/222/files#diff-c47669012d7664f9cbee69c67bf8bedfR36 Once we agree on it I will update the tests. |
121d54c
to
8330758
Compare
|
||
// Number of times baggage restrictions failed to update. | ||
BaggageRestrictionsUpdateFailure metrics.Counter `metric:"baggage-restrictions-update" tags:"result=err"` | ||
BaggageRestrictionsUpdateFailure metrics.Counter `metric:"baggage_restrictions_updates" tags:"result=err"` | ||
} |
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.
@pavolloffay @objectiser penny for your thoughts.
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.
+1 - I assume the names will be consistent across all clients?
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.
As much as possible. I don't think we have tag-based APIs in Python and Node.js clients.
Another option would be to drop tags completely and just encode them in the name, e.g. traces_started_sampled
. It makes it harder to aggregate if say you don't care about the "is_sampled" dimension.
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.
Better to have tags - is there any reason they can't be added to python and node clients?
Waiting for this PR, any update? |
eta Nov 27 |
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
8330758
to
abd1f54
Compare
Signed-off-by: Yuri Shkuro <ys@uber.com>
README.md
Outdated
tracer := config.Tracing.New("your-service-name", stats) | ||
import ( | ||
"github.com/uber/jaeger-lib/metrics/prometheus" | ||
"github.com/uber/jaeger-client-go/config" |
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.
omg imports
metrics.go
Outdated
@@ -33,63 +33,61 @@ type Metrics struct { | |||
TracesJoinedNotSampled metrics.Counter `metric:"traces" tags:"state=joined,sampled=n"` | |||
|
|||
// Number of sampled spans started by this tracer | |||
SpansStarted metrics.Counter `metric:"spans" tags:"group=lifecycle,state=started"` | |||
SpansStartedSampled metrics.Counter `metric:"spans_started" tags:"sampled=y"` |
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.
I'd prefer sampled=true and sampled=false
metrics_test.go
Outdated
Tags: map[string]string{"lib": "jaeger"}, | ||
Value: 11, | ||
}, | ||
) | ||
} | ||
|
||
// TestNewPrometheusMetrics ensures that the metrics do not have conflicting dimensions and will work with Prometheus. | ||
func TestNewPrometheusMetrics(t *testing.T) { |
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.
remind me, will this pull in all of prometheus for service owners even if they don't use prometheus metrics?
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.
I moved it to testImport: in glide. Another alternative is to move the test to a sub-package.
metrics.go
Outdated
|
||
// Number of times the Sampler succeeded to retrieve and update sampling strategy | ||
SamplerUpdated metrics.Counter `metric:"sampler" tags:"state=updated"` | ||
SamplerUpdated metrics.Counter `metric:"sampler_updated"` |
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.
"sampler_updates, result=ok" and "sampler_updates, result=err" to keep in line with the baggage stuff and we can update sampler_query_failures as you have.
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.
Still leaves sampler_retrieved and baggage_truncated ending in a verb.
Also, if we want to convert everything to end with a noun, we may consider s/spans_started/started_spans/ (finished_spans, etc.)
Signed-off-by: Yuri Shkuro <ys@uber.com>
Signed-off-by: Yuri Shkuro <ys@uber.com>
metrics.go
Outdated
@@ -33,40 +33,40 @@ type Metrics struct { | |||
TracesJoinedNotSampled metrics.Counter `metric:"traces" tags:"state=joined,sampled=n"` | |||
|
|||
// Number of sampled spans started by this tracer | |||
SpansStartedSampled metrics.Counter `metric:"spans_started" tags:"sampled=y"` | |||
SpansStartedSampled metrics.Counter `metric:"started_spans" tags:"sampled=y"` |
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.
Curious why this change? and similarly for finished_spans
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.
wanted to normalize all names to end with noun
Signed-off-by: Yuri Shkuro <ys@uber.com>
When used with Prometheus backend current metrics cannot be initialized because they use the same names (e.g. "spans") with different dimensions of the tags (e.g. "group, state" vs. "group, sampled").
This change splits different sets of metrics by name, so that a single name uses the same dimensions of tags.