How to use the @google-cloud/common.Service function in @google-cloud/common

To help you get started, we’ve selected a few @google-cloud/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / cloud-profiler-nodejs / ts / src / profiler.ts View on Github external
constructor(config: ProfilerConfig) {
    config = config || ({} as ProfilerConfig);
    const serviceConfig: ServiceConfig = {
      baseUrl: config.baseApiUrl,
      scopes: [SCOPE],
      packageJson: pjson,
    };
    super({
      parent: new Service(serviceConfig, config),
      baseUrl: '/',
    });
    this.config = config;

    this.logger = createLogger(this.config.logLevel);

    const labels: { zone?: string; version?: string; language: string } = {
      language: 'nodejs',
    };
    if (this.config.zone) {
      labels.zone = this.config.zone;
    }
    if (this.config.serviceContext.version) {
      labels.version = this.config.serviceContext.version;
    }
    this.deployment = {