2.0.20220728 • Published 2 years ago

@maxim_mazurok/gapi.client.cloudtrace v2.0.20220728

Weekly downloads
75
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Cloud Trace API v2

Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenTelemetry. For detailed description please check documentation.

Installing

Install typings for Cloud Trace API:

npm install @types/gapi.client.cloudtrace@v2 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('cloudtrace', 'v2', () => {
  // now we can use gapi.client.cloudtrace
  // ...
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [ 
      // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
      'https://www.googleapis.com/auth/cloud-platform',

      // Write Trace data for a project or application
      'https://www.googleapis.com/auth/trace.append',
    ],
    immediate = true;
// ...

gapi.auth.authorize(
  { client_id: client_id, scope: scope, immediate: immediate },
  authResult => {
    if (authResult && !authResult.error) {
        /* handle successful authorization */
    } else {
        /* handle authorization error */
    }
});

After that you can use Cloud Trace API resources:

2.0.20220728

2 years ago

2.0.20220609

2 years ago

2.0.20220622

2 years ago

2.0.20220615

2 years ago

2.0.20220706

2 years ago

2.0.20220720

2 years ago

2.0.20220713

2 years ago

2.0.20220526

2 years ago

2.0.20220512

2 years ago

2.0.20220505

2 years ago

2.0.20220428

2 years ago

2.0.20220518

2 years ago

2.0.20220413

2 years ago

2.0.20220330

2 years ago

2.0.20220407

2 years ago

2.0.20220421

2 years ago

2.0.20220310

2 years ago

2.0.20220224

2 years ago

2.0.20220303

2 years ago

2.0.20220114

2 years ago

2.0.20220128

2 years ago

2.0.20220204

2 years ago

2.0.20211115

3 years ago

2.0.20211203

2 years ago

2.0.20211105

3 years ago

2.0.20211022

3 years ago

2.0.20210930

3 years ago

2.0.20210928

3 years ago

2.0.20210917

3 years ago

2.0.20210827

3 years ago

2.0.20210812

3 years ago

2.0.20210806

3 years ago

2.0.20210730

3 years ago

2.0.20210719

3 years ago

2.0.20210628

3 years ago

2.0.20210604

3 years ago

2.0.20210524

3 years ago

2.0.20210504

3 years ago

2.0.20210422

3 years ago

2.0.20210416

3 years ago

2.0.20210409

3 years ago

2.0.20210405

3 years ago

2.0.20210325

3 years ago

2.0.20210319

3 years ago

2.0.20210316

3 years ago

2.0.20210303

3 years ago

2.0.20210222

3 years ago

2.0.20210205

3 years ago

2.0.20210129

3 years ago

2.0.20210119

3 years ago

2.0.20210115

3 years ago

2.0.20210111

3 years ago

2.0.20210105

3 years ago

2.0.20201207

3 years ago

2.0.20201107

4 years ago