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

feat: (instrumentation): increase timestamp precision #234

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

GALLLASMILAN
Copy link
Contributor

Description

I increased the span's timestamp precision. The OpenTelemetry framework does not parse the Date objects correctly.

The code is tested in the API and UI.

Checklist

  • I have read the contributor guide
  • Linting passes: yarn lint or yarn lint:fix
  • Formatting is applied: yarn format or yarn format:fix
  • Unit tests pass: yarn test:unit
  • E2E tests pass: yarn test:e2e
  • Tests are included
  • Documentation is changed or added
  • Commit messages and PR title follow conventional commits

@GALLLASMILAN GALLLASMILAN requested a review from a team as a code owner December 6, 2024 10:34
@GALLLASMILAN GALLLASMILAN requested a review from Tomas2D December 6, 2024 10:34
@@ -82,7 +82,12 @@ export function createTelemetryMiddleware() {

const eventsIterationsMap = new Map<string, Map<string, string>>();

const startTime = performance.now();
const startTimeDate = new Date().getTime();
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of new Date().getTime() you can use Date.now()

@GALLLASMILAN GALLLASMILAN merged commit 72c8717 into main Dec 6, 2024
4 checks passed
@GALLLASMILAN GALLLASMILAN deleted the opentelemetry-timestamp-precision branch December 6, 2024 12:10
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.

2 participants