-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[APM] Critical path for a single trace #143735
Changes from 7 commits
120c5e0
22baeb1
8c28f3c
96ea7da
0b61ad1
aaae194
d01ede8
1c91019
cded11e
7fb95b8
3d1787d
0e6919e
06dd608
cb4d9b5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,17 +20,18 @@ export class Service extends Entity<ApmFields> { | |
} | ||
} | ||
|
||
export function service({ | ||
name, | ||
environment, | ||
agentName, | ||
}: { | ||
name: string; | ||
environment: string; | ||
agentName: string; | ||
}) { | ||
export function service(name: string, environment: string, agentName: string): Service; | ||
|
||
export function service(options: { name: string; environment: string; agentName: string }): Service; | ||
|
||
export function service( | ||
...args: [{ name: string; environment: string; agentName: string }] | [string, string, string] | ||
) { | ||
const [serviceName, environment, agentName] = | ||
args.length === 1 ? [args[0].name, args[0].environment, args[0].agentName] : args; | ||
Comment on lines
+23
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't this overcomplicate this a bit? Is it really necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above. |
||
|
||
return new Service({ | ||
'service.name': name, | ||
'service.name': serviceName, | ||
'service.environment': environment, | ||
'agent.name': agentName, | ||
}); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 looks very weird, why is it needed?
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.
it's basically method overloading, but in one signature. I think span(spanName) is often good enough and more concise than span({ spanName: ... }). I previously discussed this with @sqren when he changed it, and IIRC(?) we decided I would add back the original method when I would have time.
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 agree it makes the signature simpler but I'd rather be without the extra complexity in synthtrace. But I don't feel strongly for it either way.
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.
Actually, I'll take that back. I don't think the signature improved except for
transaction()
with a single arg.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 think the signature is more complicated but not less easy to use, which is my goal. Like you know, I disagree about span({...}) and transaction({...}) being the better interface. I do we think should add more defaults for span() though, IMHO span(spanName) is good enough too, we can default to custom/custom for span type and subtype.