-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
chore: Pass telemetry resources from the node process to the browser #26468
Conversation
packages/telemetry/src/index.ts
Outdated
@@ -30,6 +30,7 @@ export interface TelemetryApi { | |||
findActiveSpan(fn: findActiveSpanOptions): Span | undefined | |||
endActiveSpanAndChildren (span?: Span | undefined): void | |||
getActiveContextObject (): contextObject | |||
getResources (): {} |
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.
is it always a key value pair of strings in this case kinda similar to the tests?
getResources (): {} | |
getResources (): {[key: string]: string} |
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 know it's always serializable, but it might be numbers too
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.
maybe getResources (): {[key: string]: string | number}
?
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.
lol, i tried that it's more complex (how about booleans? how about arrays of strings?). I'm going to try to reuse an opentelmetry 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.
worse case I feel like {[key: string]: string}
is acceptable since it sounds like it could be any serializable type. Or it is always a primitive we could do something like {[key: string]: string | number | boolean | undefined | null}
(assuming no symbols or bigint)?
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.
The otel type appears to be working for us.
Co-authored-by: Bill Glesias <[email protected]>
@@ -103,7 +103,6 @@ declare global { | |||
__RUN_MODE_SPECS__: SpecFile[] | |||
__CYPRESS_TESTING_TYPE__: 'e2e' | 'component' | |||
__CYPRESS_BROWSER__: Partial<Browser> & {majorVersion: string | number} | |||
__CYPRESS_TELEMETRY__?: {context: {traceparent: string}} |
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.
removed duplicative typing, at least as far as i can tell we don't need it with the type defined in browsers.ts
@@ -51,8 +53,10 @@ export class OTLPTraceExporter extends OTLPTraceExporterHttp { | |||
return | |||
} | |||
|
|||
// Continue to send this header for passivity until the cloud is released. |
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.
Is there an issue logged to remove this one the cloud is 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.
Nope, I was just planning to do it myself once i was notified that cloud had released.
Co-authored-by: Matt Schile <[email protected]>
…ypress-io#26468) * chore: pass resources from the node process to the browser * don't check version * Apply suggestions from code review Co-authored-by: Bill Glesias <[email protected]> * reuse type for attributes * use auth header * ts? * Update packages/telemetry/src/index.ts Co-authored-by: Matt Schile <[email protected]> --------- Co-authored-by: Bill Glesias <[email protected]> Co-authored-by: Matt Schile <[email protected]>
* feat/protocol: (45 commits) chore: adding support for url:changed (#26519) chore: adding viewport:changed to protocol (#26508) chore: Reduce dependencies and binary size, add circle ci detector (#26522) chore: 12.10.0 release (#26517) test: fix flaky tests (#26505) chore: Check project dependencies for CT compatibility (#26497) chore: update vm2 to 3.9.16 (#26489) chore: enable builds on feat/protocol branch (#26506) chore: [skip ci] update to labels looked at by stalebot (#26496) chore: connecting to electron browser (#26471) chore: [skip ci] turning on stale bot (#26488) chore: fix issue with logs without wallClockUpdatedAt (#26473) Update triage_add_to_project.yml chore: Update Chrome (stable) to 112.0.5615.49 and Chrome (beta) to 113.0.5672.24 (#26434) feat: display framework definition errors (#26183) fix: correctly resolve dependencies for CT onboarding when using Yarn Plug n Play (#26452) fix: Subscribe to framework detection changes in wizard (#26437) fix: make clicks on type('{enter}') composed (#26395) chore: update add-to-project workflow (#26439) chore: Pass telemetry resources from the node process to the browser (#26468) ...
Additional details
I noticed that resource information like 'ci.branch' were not getting applied to spans logged from the browser, this change passes resources declared in the node process up to the browser process to ensure they also get logged.
Steps to test
Check for the presence of ci.branch on spans logged from the browser in honeycomb.
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?