Skip to content

Conversation

@Abinet18
Copy link
Contributor

@Abinet18 Abinet18 commented Oct 6, 2025

Which problem is this PR solving?

Creates a new instrumentation for browser navigation, in place of page view instrumentation that was being worked in this PR, with event defined in SemConv for this event

Short description of the changes

  • Fire a browser navigation event when an html loads, route changes (push, replace , pop), hash changes, and navigating through the navigation api if available

@Abinet18 Abinet18 requested a review from a team as a code owner October 6, 2025 21:06
@github-actions github-actions bot requested a review from martinkuba October 6, 2025 21:06
@Abinet18 Abinet18 changed the title Feat/instrumentation navigation Feat : Browser Navigation Instrumentation Oct 6, 2025
@Abinet18 Abinet18 changed the title Feat : Browser Navigation Instrumentation feat : Browser Navigation Instrumentation Oct 6, 2025
@Abinet18 Abinet18 changed the title feat : Browser Navigation Instrumentation feat: Browser Navigation Instrumentation Oct 6, 2025
@Abinet18 Abinet18 force-pushed the feat/instrumentation-navigation branch from a1fbf7d to 9ef7a8a Compare October 10, 2025 17:09
@pichlermarc pichlermarc added the Target: Browser Targets on Browser label Oct 15, 2025
Copy link
Contributor

@david-luna david-luna left a comment

Choose a reason for hiding this comment

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

that's a very good start :)

@Abinet18 Abinet18 force-pushed the feat/instrumentation-navigation branch from b4f4f99 to 42bfa43 Compare October 29, 2025 17:26
@martinkuba martinkuba moved this to In Progress in Browser: Phase 1 Oct 30, 2025
*/
constructor(config: BrowserNavigationInstrumentationConfig) {
super(PACKAGE_NAME, PACKAGE_VERSION, config);
this.eventLogger = logs.getLogger(PACKAGE_NAME, PACKAGE_VERSION);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@overbalance overbalance left a comment

Choose a reason for hiding this comment

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

I would run npx prettier --write packages/instrumentation-browser-navigation as well.

Comment on lines +46 to +51
// All true by default; override as needed
emitOnPageLoad: true,
emitOnHistoryChange: true,
emitOnPopState: true,
emitOnHashChange: true,
// useNavigationApiIfAvailable: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like this is out-of-date.

} from '@opentelemetry/sdk-logs';
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is example is using old core/resources. Should it be using ^2.0.0?

import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { Resource } from '@opentelemetry/resources';
import { SEMRESATTRS_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here because this is deprecated.

"@opentelemetry/exporter-logs-otlp-http": "^0.52.1",
"@opentelemetry/exporter-trace-otlp-http": "^0.39.1",
"@opentelemetry/instrumentation": "^0.39.1",
"@opentelemetry/instrumentation-document-load": "^0.32.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would keep this explicitly imported.

@overbalance
Copy link
Contributor

@Abinet18 I forgot to mention that you should delete package-lock.json and node_modules and then npm i. You got bit by an npm bug that removed the linux binaries from the lockfile. Then you should see the build pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Target: Browser Targets on Browser

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants