Coder Social home page Coder Social logo

DataDog RUM Integration about argo-cd HOT 2 OPEN

zhammer avatar zhammer commented on June 3, 2024 3
DataDog RUM Integration

from argo-cd.

Comments (2)

zhammer avatar zhammer commented on June 3, 2024

From discussion in the argo contributor meeting, we're going to try implementing this as an extension

from argo-cd.

zhammer avatar zhammer commented on June 3, 2024

We've implemented this using a UI extension. Happy to open source though it's a little unclear what the best way to do that is since it requires custom configuration on the rum sdk (and also optional configuration). Anyway here's the extension index.ts we run:

import { datadogRum } from '@datadog/browser-rum';

async function setUser() {
    const res = await fetch(`/api/v1/session/userinfo`)
    if (res.status !== 200) {
        throw new Error(`Failed to get user info: ${res.status}`);
    }
    const { username } = await res.json();
    datadogRum.setUser({ id: username });
}

function initDDRum() {
    datadogRum.init({
        applicationId: '<application_id>',
        clientToken: '<client_token>',
        service: 'argocd',
        traceSampleRate: 100,
        telemetrySampleRate: 100,
        sessionSampleRate: 100,
        sessionReplaySampleRate: 100,
        trackUserInteractions: true,
    })

    setUser().catch(e => console.warn('Failed to set user:', e));
}

initDDRum();

we build it with webpack into a dist file that gets installed to argocd.

from argo-cd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.