-
Notifications
You must be signed in to change notification settings - Fork 11.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration: Update tracing section to clarify GF_TRACING prefix applies to all Jaeger variables #32666
Conversation
…eger variables Signed-off-by: Conor Evans <coevans@tcd.ie>
@@ -1222,7 +1226,7 @@ Specifies the type of sampler: `const`, `probabilistic`, `ratelimiting`, or `rem | |||
|
|||
Refer to https://www.jaegertracing.io/docs/1.16/sampling/#client-sampling-configuration for details on the different tracing types. | |||
|
|||
Can be set with the environment variable `JAEGER_SAMPLER_TYPE`. | |||
Can be set with the environment variable `GF_TRACING_JAEGER_SAMPLER_TYPE`. |
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 suppose this and sampler_param
do follow the convention already given that it is under [tracing.jaeger.sampler_type]
but it's called out as JAEGER_SAMPLER_TYPE
here (when it doesn't need to be, given that it follows the GF_<section>_<parameter>
convention). So I think the comment could either be updated as here, or removed entirely, but as JAEGER_SAMPLER_TYPE
I do think it's somewhat confusing.
|
||
### address | ||
|
||
The host:port destination for reporting spans. (ex: `localhost:6831`) | ||
|
||
Can be set with the environment variables `JAEGER_AGENT_HOST` and `JAEGER_AGENT_PORT`. | ||
Can be set with the environment variables `GF_TRACING_JAEGER_AGENT_HOST` |
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 have actually submitted an issue relating to these env vars as they do not enable tracing - address
must be set, unlike it states here. #32667
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.
This doesn't look right. You can actually set it either using GF_TRACING_JAEGER_ADDRESS
or either using JAEGER_AGENT_HOST
and JAEGER_AGENT_PORT
, see https://www.jaegertracing.io/docs/1.16/client-features/.
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 used JAEGER_AGENT_HOST
and JAEGER_AGENT_PORT
initially and it did not initialize tracing for me. Let's look at tracing.go
:
func (ts *TracingService) Init() error {
ts.log = log.New("tracing")
ts.parseSettings()
if ts.enabled {
return ts.initGlobalTracer()
}
return nil
}
ts.initGlobalTracer()
is where the Jaeger Cfg is parsed:
func (ts *TracingService) initGlobalTracer() error {
cfg, err := ts.initJaegerCfg()
if err != nil {
return err
}
....
And it'll only go to ts.initGlobalTracer()
if ts.enabled
. So let's return to ts.ParseSettings()
just before it:
func (ts *TracingService) parseSettings() {
var section, err = ts.Cfg.Raw.GetSection("tracing.jaeger")
if err != nil {
return
}
ts.address = section.Key("address").MustString("")
if ts.address != "" {
ts.enabled = true
}
...
We can see ts.enabled
is explictly dependent on GF_TRACING_JAEGER_ADDRESS
.
Maybe the Jaeger config would start up successfully using JAEGER_AGENT_HOST
and JAEGER_AGENT_PORT
(rather than GF_TRACING_JAEGER_AGENT_PORT
, so the update to the text here isn't relevant, but the issue #32667 is relevant.
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.
#32667 is definitely relevant for enable tracing and should be fixed. I thought that actually was fixed, but I was wrong. I'm pretty sure there was some other PR that changed things. Had #23887 in mind, but no it didn't touch upon this problem. #25768 is related, but didn't really do anything in regards to enable tracing. Maybe I started some work on this back in the day, but never ended up in a PR?
However, if you would provide a value for GF_TRACING_JAEGER_ADDRESS
and values for JAEGER_AGENT_HOST
and JAEGER_AGENT_PORT
I think the latter ones would be used.
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.
However, if you would provide a value for GF_TRACING_JAEGER_ADDRESS and values for JAEGER_AGENT_HOST and JAEGER_AGENT_PORT I think the latter ones would be used.
Yeah definitely.
I think this PR arose from my troubles at #32667. I think this PR can be closed - after the above comment where I dug a bit further, I realized that these docs would be fine and accurate if #32667 did not exist.
Need developer review and approval. |
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.
Standard jaeger environment variables are still supported and should still be documented, but agree that explaining that GF_<section>
convention also could be used is a good thing.
@@ -1201,18 +1201,22 @@ Configure Grafana's Jaeger client for distributed tracing. | |||
You can also use the standard `JAEGER_*` environment variables to configure | |||
Jaeger. See the table at the end of https://www.jaegertracing.io/docs/1.16/client-features/ | |||
for the full list. Environment variables will override any settings provided here. | |||
These environment variables follow the `GF_<section>` convention above, |
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.
Based on information about standard jaeger environment variables above (documented at https://www.jaegertracing.io/docs/1.16/client-features/) this needs to explain that you can use GF_<section>
convention if you prefer as well.
The reason for using standard jaeger environment variables is because some uses that for all their services, including Grafana, as convenience.
|
||
### always_included_tag | ||
|
||
Comma-separated list of tags to include in all new spans, such as `tag1:value1,tag2:value2`. | ||
|
||
Can be set with the environment variable `JAEGER_TAGS` (use `=` instead of `:` with the environment variable). | ||
Can be set with the environment variable `GF_TRACING_JAEGER_TAGS` |
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.
Information about JAEGER_TAGS
is still needed, but you can explain that GF_TRACING_JAEGER_TAGS
can be used as well.
Signed-off-by: Conor Evans coevans@tcd.ie
What this PR does / why we need it: Since these variables do not feature in the
[tracing.jaeger]
section and they are explicitly called out asJAEGER_...
, it was definitely not clear to me that theGF_<section>
prefix applied here. I spent some time trying to debug, seeing if there was a problem with the agent, before I realized that I wasn't seeing anything tracing related in the logs on startup. I took a hunch on this and my hunch was confirmed: