-
Notifications
You must be signed in to change notification settings - Fork 616
feat: Browser Navigation Instrumentation #3148
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
base: main
Are you sure you want to change the base?
feat: Browser Navigation Instrumentation #3148
Conversation
a1fbf7d to
9ef7a8a
Compare
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.
that's a very good start :)
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
b4f4f99 to
42bfa43
Compare
packages/instrumentation-browser-navigation/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
| */ | ||
| constructor(config: BrowserNavigationInstrumentationConfig) { | ||
| super(PACKAGE_NAME, PACKAGE_VERSION, config); | ||
| this.eventLogger = logs.getLogger(PACKAGE_NAME, PACKAGE_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.
InstrumentationAbstract already provides a getter for the logger in https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts#L96-L98
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 would run npx prettier --write packages/instrumentation-browser-navigation as well.
| // All true by default; override as needed | ||
| emitOnPageLoad: true, | ||
| emitOnHistoryChange: true, | ||
| emitOnPopState: true, | ||
| emitOnHashChange: true, | ||
| // useNavigationApiIfAvailable: false, |
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.
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'; |
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 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'; |
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.
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", |
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 would keep this explicitly imported.
|
@Abinet18 I forgot to mention that you should delete |
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