Skip to content
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

Capture visibility events #219

Merged
merged 8 commits into from
Jul 27, 2021
Merged

Capture visibility events #219

merged 8 commits into from
Jul 27, 2021

Conversation

mhennoch
Copy link
Contributor

Captured as 0 duration spans as these can't be complete spans(due to us not being able to close some of them in some case) and we don't have events. Disabled for now cause we need to make sure that sending them is fine. At some point we probably need to add this info to each span so data can be filtered in UI.

Code in index.ts is moved cause otherwise some things fire at wrong times.

@mhennoch mhennoch requested a review from a team as a code owner July 20, 2021 20:08
@mhennoch mhennoch requested a review from a team July 20, 2021 20:08
@mhennoch mhennoch temporarily deployed to integration July 22, 2021 17:30 Inactive
@mhennoch mhennoch temporarily deployed to integration July 22, 2021 17:30 Inactive
this.unloading = false;
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be configured in eslint? Especially, if all instances of InstrumentationBase require init() to be present.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched off globally

import { VERSION } from './version';

const MODULE_NAME = 'splunk-visibility';
let visibilityListener: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these listeners be fields of the instrumentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

});
browser.globals.emulateTabSwitching = async (visible) => {
await browser.execute((hidden) => {
Object.defineProperty(document, 'hidden', { value: hidden, configurable: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this, I'd suggest we make it a unit test. This isn't how an integration test should work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will look into making it a real integration test with a real tab switch at some point

Copy link
Contributor

@jtmal-signalfx jtmal-signalfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No major issues, I'd prefer that the tests for visibility are unit tests because of how they work.

@mhennoch mhennoch temporarily deployed to integration July 27, 2021 11:45 Inactive
@mhennoch mhennoch merged commit 8f40e68 into main Jul 27, 2021
@mhennoch mhennoch deleted the visibility-event branch July 27, 2021 12:33
sfishel-splunk pushed a commit to sfishel-splunk/splunk-otel-js-web that referenced this pull request Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants