collab: Include geoip_country_code
in initial span (#15819)
This PR changes how we report the `geoip_country_code` in the tracing spans. I wasn't seeing it come through in the logs, and I think it was because we didn't declare the field on the initial span. Release Notes: - N/A
This commit is contained in:
parent
04ad088eb8
commit
705f7e7a03
1 changed files with 6 additions and 4 deletions
|
@ -998,9 +998,13 @@ impl Server {
|
||||||
user_id=field::Empty,
|
user_id=field::Empty,
|
||||||
login=field::Empty,
|
login=field::Empty,
|
||||||
impersonator=field::Empty,
|
impersonator=field::Empty,
|
||||||
dev_server_id=field::Empty
|
dev_server_id=field::Empty,
|
||||||
|
geoip_country_code=field::Empty
|
||||||
);
|
);
|
||||||
principal.update_span(&span);
|
principal.update_span(&span);
|
||||||
|
if let Some(country_code) = geoip_country_code.as_ref() {
|
||||||
|
span.record("geoip_country_code", country_code);
|
||||||
|
}
|
||||||
|
|
||||||
let mut teardown = self.teardown.subscribe();
|
let mut teardown = self.teardown.subscribe();
|
||||||
async move {
|
async move {
|
||||||
|
@ -1014,9 +1018,7 @@ impl Server {
|
||||||
let executor = executor.clone();
|
let executor = executor.clone();
|
||||||
move |duration| executor.sleep(duration)
|
move |duration| executor.sleep(duration)
|
||||||
});
|
});
|
||||||
tracing::Span::current()
|
tracing::Span::current().record("connection_id", format!("{}", connection_id));
|
||||||
.record("connection_id", format!("{}", connection_id))
|
|
||||||
.record("geoip_country_code", geoip_country_code.clone());
|
|
||||||
|
|
||||||
tracing::info!("connection opened");
|
tracing::info!("connection opened");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue