getClusterId()

in src/scaler/scaler-core/state.js [154:166]


  getClusterId() {
    const instanceIdPrefix = `projects/${this.projectId}/locations/${this.regionId}`;
    switch (this.engine) {
      case AutoscalerEngine.REDIS:
        return `${instanceIdPrefix}/clusters/${this.clusterId}`;
      case AutoscalerEngine.VALKEY:
        return `${instanceIdPrefix}/instances/${this.clusterId}`;
      default:
        throw new Error(
          `Unknown engine constructing ID for state store: ${this.engine}`,
        );
    }
  }