1.4.6 • Published 4 years ago

@ns-gapi/instrumentation v1.4.6

Weekly downloads
25
License
ISC
Repository
-
Last release
4 years ago

Instrumentation

Basic usage

    const {ProviderApplication} = require('@ns-gapi/instrumentation/dist');
    const application = new ProviderApplication({
        key: 'application-key',
        env: 'sandbox',
    });

    // Application start will wait for developer key sync event
    await application.start();

    // Key provided by user for the request
    const developerKey = 'user-provided-key';

    // Developer key validation is sync as keys are cached locally
    if (!application.isValidDeveloperKey(developerKey)) {
        throw new Error('invalid key');
    }

    // Start transaction
    const transaction = application
        .startTransaction('transaction') // transaction type
        .withMetadata({custom: true}) // set some metadata
        .withDeveloperKey(developerKey);

    // finish transaction
    transaction.finish();
1.4.6

4 years ago

1.4.5

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago