Skip to content

Commit

Permalink
Liron/llm 3307 femon track only our own deployment (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
lironhamra authored Jul 18, 2024
1 parent 45fb965 commit d3aeb0d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
with:
requirements: "backend/requirements-all.txt"
fail: "Copyleft,Other,Error"
exclude: '(envier.*0\.5\.0|psycopg2.*2\.9\.3|fqdn.*1\.5\.1|pyzmq.*25\.1\.2|debugpy.*1\.6\.7|certifi.*2024\.6\.2|tqdm.*4\.66\.4|webencodings.*0\.5\.1|torch.*1\.10\.2.*|torch.*1\.11\.0.*|pytorch-ignite.*0\.4\.10.*|torchaudio.*0\.11\.0.*|torchvision.*0\.12\.0.*|terminado.*0\.15\.0|qudida.*0\.0\.4|expiringdict.*1\.2\.2|botocore.*1\.29\.80|orderedmultidict.*1\.0\.1|deepchecks.*)'
exclude: '(envier.*0\.5\.0|psycopg2.*2\.9\.3|fqdn.*1\.5\.1|pyzmq.*25\.1\.2|debugpy.*1\.6\.7|certifi.*2024\.7\.4|tqdm.*4\.66\.4|webencodings.*0\.5\.1|torch.*1\.10\.2.*|torch.*1\.11\.0.*|pytorch-ignite.*0\.4\.10.*|torchaudio.*0\.11\.0.*|torchvision.*0\.12\.0.*|terminado.*0\.15\.0|qudida.*0\.0\.4|expiringdict.*1\.2\.2|botocore.*1\.29\.80|orderedmultidict.*1\.0\.1|deepchecks.*)'
# psycopg2 is LGPL 2
# pyzmq is Revised BSD https://github.com/zeromq/pyzmq/blob/main/examples/LICENSE
# debugpy is MIT https://github.com/microsoft/debugpy/blob/main/LICENSE
Expand Down
1 change: 1 addition & 0 deletions backend/deepchecks_monitoring/ee/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ class Settings(
access_audit: bool = False
hotjar_sv: str = ''
hotjar_id: str = ''
datadog_fe_token: str = ''
3 changes: 2 additions & 1 deletion backend/deepchecks_monitoring/ee/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def get_client_configuration(self) -> dict:
"mixpanel_id": settings.mixpanel_id,
"is_cloud": True,
"hotjar_id": settings.hotjar_id,
"hotjar_sv": settings.hotjar_sv
"hotjar_sv": settings.hotjar_sv,
"datadog_fe_token": settings.datadog_fe_token,
}
return super().get_client_configuration()

Expand Down
3 changes: 2 additions & 1 deletion backend/deepchecks_monitoring/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,5 +494,6 @@ def get_client_configuration(self) -> "dict[str, t.Any]":
"mixpanel_id": None,
"is_cloud": False,
"hotjar_id": None,
"hotjar_sv": None
"hotjar_sv": None,
"datadog_fe_token": None,
}
2 changes: 1 addition & 1 deletion frontend/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ REACT_APP_NODE_ENV=production
REACT_APP_BASE_API=""
REACT_APP_MIXPANEL_ID=2d6c91b382a9fb587aeabbd67c207d38
REACT_APP_DATADOG_ID="866ddc30-59d3-4d7a-bff3-bb792c963c5e"
REACT_APP_DATADOG_TOKEN="puba69fc7ca5e5defc9cad25cd80e1c7bdf"
REACT_APP_DATADOG_TOKEN=""
7 changes: 3 additions & 4 deletions frontend/src/helpers/context/InitializationProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@ import useConfig from '../hooks/useConfig';
import { getStorageItem, storageKeys } from 'helpers/utils/localStorage';

const InitializationProvider = ({ children }: { children: ReactNode | ReactNode[] }) => {
const { hotjar_sv, hotjar_id, data_dog_id, data_dog_token, mixpanel_id, environment } = useConfig() as {
const { hotjar_sv, hotjar_id, data_dog_id, mixpanel_id, environment, datadog_fe_token } = useConfig() as {
[key: string]: string;
};

// DataDog
const dataDogId = data_dog_id;
const dataDogToken = data_dog_token;
const isTrackable = `${process.env.REACT_APP_NODE_ENV}` === 'production';
const userName = getStorageItem(storageKeys?.user)?.u_name ?? '';
const userEmail = getStorageItem(storageKeys?.user)?.u_email ?? '';

if (dataDogToken && dataDogId && isTrackable) {
if (datadog_fe_token && dataDogId && isTrackable) {
datadogRum.init({
env: environment,
trackResources: true,
trackLongTasks: true,
site: 'datadoghq.com',
service: 'mon-client',
applicationId: dataDogId,
clientToken: dataDogToken,
clientToken: datadog_fe_token,
trackUserInteractions: true,
defaultPrivacyLevel: 'allow',
sessionReplaySampleRate: 100,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/helpers/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { resError } from 'helpers/types/resError';

const initialVars = {
data_dog_id: `${process.env.REACT_APP_DATADOG_ID}`,
data_dog_token: `${process.env.REACT_APP_DATADOG_TOKEN}`,
datadog_fe_token: `${process.env.REACT_APP_DATADOG_TOKEN}`,
environment: `${process.env.REACT_APP_BASE_API}`,
mixpanel_id: `${process.env.REACT_APP_MIXPANEL_ID}`
};
Expand Down

0 comments on commit d3aeb0d

Please sign in to comment.