-
Notifications
You must be signed in to change notification settings - Fork 16
Add enrichment for user_agent.{name, version} #174
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
Conversation
| if s.userAgentName == "" && s.inferredUserAgentName != "" { | ||
| span.Attributes().PutStr(semconv27.AttributeUserAgentName, s.inferredUserAgentName) | ||
| } | ||
| if s.userAgentVersion == "" && s.inferredUserAgentVersion != "" { | ||
| span.Attributes().PutStr(semconv27.AttributeUserAgentVersion, s.inferredUserAgentVersion) | ||
| } |
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.
[For reviewers] I am setting the user_agent.{name, version} only if it is not already set.
gregkalapos
left a comment
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.
lgtm
| }(), | ||
| }, | ||
| { | ||
| name: "user_agent_parse_name_version", |
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.
nit: I'd postfix these with something like _span and _transaction. So e.g. user_agent_parse_name_version_transaction here and user_agent_parse_name_version_span below, instead of having them with the same name.
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.
They would be reported as TestElastic{Transaction, Span}Enrich/user_agent_parse_name_version, is that not enough or is it for when looking at the tests individually without the context of the main test?
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.
Yeah, you are right. It's good enough. It just took me a few seconds to realize what's actually the difference is in these new tests with the same name. But yeah, this is ok - if the test fails, the output is clear.
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.
Cool, I am thinking to simplify these tests with a method for default enrichments... currently the tests are getting a bit hard to read an unnecessarily verbose. Will do it later as a followup.
Adds enrichment for
user_agent.{name, version}if it is missing. The attributes are derived fromuser_agent.original.Closes: #172