Skip to content

chore: add apm monitoring#276

Open
laurentC35 wants to merge 8 commits into
feat/synchronize-improvementsfrom
feat(obs)/add-apm-run-js-agent
Open

chore: add apm monitoring#276
laurentC35 wants to merge 8 commits into
feat/synchronize-improvementsfrom
feat(obs)/add-apm-run-js-agent

Conversation

@laurentC35
Copy link
Copy Markdown
Collaborator

@laurentC35 laurentC35 commented Mar 24, 2026

Feature

  • enable monitoring of real user actions
  • feature flag to enable this feature (disabled by default)

Why

With this dependencies we can have synchronization time with this apm (we need to test it)

See docs here: https://www.elastic.co/docs/reference/apm/agents/rum-js

We can consider adding React adapter (if we want to trace specific feature with React), but I'm not sure.
The react-adapter only work with react-router for monitoring route feature (and not react-router-dom or tansack-router)

So I think we can consider only the core package (@elastic/apm-rum)

@laurentC35 laurentC35 requested review from QRuhier and SimonDmz March 24, 2026 16:13
Comment thread src/index.tsx Outdated
import { monitoringService } from './core/monitoring';

if (monitoringService.isActive()) {
console.log('MONTIRING is active');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log('MONTIRING is active');
console.log('MONITORING is active');

not so tiring 😜


const syncFunction = () => {
const launchSynchronize = async () => {
synchronisationTransaction = monitoringService.startTransaction(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

will inactive monitoringService accept startTransaction method ?
NPE ?

import { MONITORING_SYNC_TYPE, monitoringService } from 'core/monitoring';
import { Transaction } from '@elastic/apm-rum';

let synchronisationTransaction: Transaction | undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

two apps sync is a mess 🙈
=> can't wait for unified synchronization 🤞

Comment thread src/core/monitoring/index.ts Outdated
};

export const monitoringService = init({
serviceName: 'sabiane-collecte-ui',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe define the serviceName in viteEnv variable

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