Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.0-beta #50

Merged
merged 66 commits into from
Jan 20, 2022
Merged

V2.0-beta #50

merged 66 commits into from
Jan 20, 2022

Conversation

DavyJohnes
Copy link
Contributor

No description provided.

Ivan Zuev and others added 30 commits December 15, 2021 14:51
BREAKING CHANGE: changed API of service clients
BREAKING CHANGE: changed API of Session
BREAKING CHANGE: removed some useless classes
# [2.0.0-alpha.1](v1.4.3...v2.0.0-alpha.1) (2021-12-24)

### Bug Fixes

* cache node_modules between jobs ([0a9490a](0a9490a))
* disable husky hooks in CI ([4919d54](4919d54))
* eslint rule ([e097134](e097134))
* move legacy code to separate directory ([b38248c](b38248c))
* move to axios ([438f7c6](438f7c6))
* remove prettier ([6bf0f24](6bf0f24))
* remove unused test module ([4e90a92](4e90a92))
* update ts-proto ([a20a650](a20a650))
* use bot's name/email for pushing release commits ([3b2553a](3b2553a))
* use bot's token for pushing release commits ([76cf6e7](76cf6e7))

### Features

* added git submodule with yandex cloud api specs ([7916612](7916612))
* endpoints list for all available service clients ([78c2355](78c2355))
* generate exports for all entities in cloud api ([5136bb5](5136bb5))
* operation utilities ([e82e279](e82e279))
* regenerate code with new ts-proto ([1e2dcc2](1e2dcc2))
* remove old generated code ([a5ecb33](a5ecb33))
* remove unused legacy code and dependencies ([3d3a6f2](3d3a6f2))
* restructure directories ([55bf685](55bf685))
* reworked examples ([2875275](2875275))
* rewrite index module in ts ([99e8ba8](99e8ba8))
* session class ([826e6de](826e6de))
* token services ([8b730df](8b730df))
* tool for code generation ([b463cf8](b463cf8))

### BREAKING CHANGES

* removed some useless classes
* changed API of Session
* changed API of service clients
(cherry picked from commit ad72226)
@DavyJohnes
Copy link
Contributor Author

@DavyJohnes Кажется тут ошибка. https://github.com/yandex-cloud/nodejs-sdk/blob/alpha/src/service-endpoints.ts#L164-L169

{
        serviceIds: [
            'yandex.cloud.logging.v1.LogGroupService',
            'yandex.cloud.logging.v1.LogIngestionService',
            'yandex.cloud.logging.v1.LogReadingService',
        ],
        endpoint: 'logs.api.cloud.yandex.net:443',
    },

А должно быть как тут https://api.cloud.yandex.net/endpoints ingester.logging.yandexcloud.net:443

Спасибо! Пофикшено в 2.0.0-alpha.3. Более того, в session.client() добавил второй параметр, чтобы иметь возможность переопределить эндпоинт.

@pltnm239 попробуете еще раз?

@pltnm239
Copy link

@DavyJohnes Кажется тут ошибка. https://github.com/yandex-cloud/nodejs-sdk/blob/alpha/src/service-endpoints.ts#L164-L169

{
        serviceIds: [
            'yandex.cloud.logging.v1.LogGroupService',
            'yandex.cloud.logging.v1.LogIngestionService',
            'yandex.cloud.logging.v1.LogReadingService',
        ],
        endpoint: 'logs.api.cloud.yandex.net:443',
    },

А должно быть как тут https://api.cloud.yandex.net/endpoints ingester.logging.yandexcloud.net:443

Спасибо! Пофикшено в 2.0.0-alpha.3. Более того, в session.client() добавил второй параметр, чтобы иметь возможность переопределить эндпоинт.

@pltnm239 попробуете еще раз?

Пробую, теперь ошибка: UnhandledPromiseRejectionWarning: ClientError: /yandex.cloud.logging.v1.LogIngestionService/Write INVALID_ARGUMENT: no valid entries хотя entries по тайпингам валидный.

@DavyJohnes
Copy link
Contributor Author

DavyJohnes commented Jan 12, 2022

@DavyJohnes Кажется тут ошибка. https://github.com/yandex-cloud/nodejs-sdk/blob/alpha/src/service-endpoints.ts#L164-L169

{
        serviceIds: [
            'yandex.cloud.logging.v1.LogGroupService',
            'yandex.cloud.logging.v1.LogIngestionService',
            'yandex.cloud.logging.v1.LogReadingService',
        ],
        endpoint: 'logs.api.cloud.yandex.net:443',
    },

А должно быть как тут https://api.cloud.yandex.net/endpoints ingester.logging.yandexcloud.net:443

Спасибо! Пофикшено в 2.0.0-alpha.3. Более того, в session.client() добавил второй параметр, чтобы иметь возможность переопределить эндпоинт.
@pltnm239 попробуете еще раз?

Пробую, теперь ошибка: UnhandledPromiseRejectionWarning: ClientError: /yandex.cloud.logging.v1.LogIngestionService/Write INVALID_ARGUMENT: no valid entries хотя entries по тайпингам валидный.

Подозреваю там level является обязательным полем. По поводу тайпингов замечание справедливое, подумаю что с этим сделать.

export interface IncomingLogEntry {
  $type: "yandex.cloud.logging.v1.IncomingLogEntry";
  /** Timestamp of the entry. */
  timestamp?: Date;
  /**
   * Entry severity.
   *
   * See [LogLevel.Level] for details.
   */
  level: LogLevel_Level;
  /** Entry text message. */
  message: string;
  /** Entry annotation. */
  jsonPayload?: { [key: string]: any };
}

@pltnm239
Copy link

pltnm239 commented Jan 12, 2022

@DavyJohnes Кажется тут ошибка. https://github.com/yandex-cloud/nodejs-sdk/blob/alpha/src/service-endpoints.ts#L164-L169

{
        serviceIds: [
            'yandex.cloud.logging.v1.LogGroupService',
            'yandex.cloud.logging.v1.LogIngestionService',
            'yandex.cloud.logging.v1.LogReadingService',
        ],
        endpoint: 'logs.api.cloud.yandex.net:443',
    },

А должно быть как тут https://api.cloud.yandex.net/endpoints ingester.logging.yandexcloud.net:443

Спасибо! Пофикшено в 2.0.0-alpha.3. Более того, в session.client() добавил второй параметр, чтобы иметь возможность переопределить эндпоинт.
@pltnm239 попробуете еще раз?

Пробую, теперь ошибка: UnhandledPromiseRejectionWarning: ClientError: /yandex.cloud.logging.v1.LogIngestionService/Write INVALID_ARGUMENT: no valid entries хотя entries по тайпингам валидный.

Подозреваю там level является обязательным полем. По поводу тайпингов замечание справедливое, подумаю что с этим сделать.

export interface IncomingLogEntry {
  $type: "yandex.cloud.logging.v1.IncomingLogEntry";
  /** Timestamp of the entry. */
  timestamp?: Date;
  /**
   * Entry severity.
   *
   * See [LogLevel.Level] for details.
   */
  level: LogLevel_Level;
  /** Entry text message. */
  message: string;
  /** Entry annotation. */
  jsonPayload?: { [key: string]: any };
}

А я не могу ориентироваться на документацию https://cloud.yandex.ru/docs/logging/api-ref/grpc/log_ingestion_service ?
Тут из обязательных только destination.

Странно, но указание level не помогает (ни числовое ни строковое значение из списка). Ошибка та же самая.

@DavyJohnes
Copy link
Contributor Author

А я не могу ориентироваться на документацию https://cloud.yandex.ru/docs/logging/api-ref/grpc/log_ingestion_service ? Тут из обязательных только destination.

Странно, но указание level не помогает (ни числовое ни строковое значение из списка). Ошибка та же самая.

Да, можно ориентироваться на документацию. Чуть позже гляну в чем там дело.

@nikolaymatrosov
Copy link
Contributor

@pltnm239 поле entries[].timestamp обязательно. Без него записи не проходят валидацию, отбрасываются и вы собственно получаете ошибку, что валидных записей в запросе не передано: no valid entries.

@pltnm239
Copy link

pltnm239 commented Jan 13, 2022

Может вы поможете разобраться, в чем же дело:)

Если комментирую TypeError тут node_modules/@grpc/grpc-js/build/src/channel.js, и оно работает, логи отправляются.

        if (!(credentials instanceof channel_credentials_1.ChannelCredentials)) {
			console.log(credentials);
			console.log(channel_credentials_1.ChannelCredentials);
            // throw new TypeError('Channel credentials must be a ChannelCredentials object');
        }

В консоли два объекта:

ComposedChannelCredentialsImpl {
  callCredentials: SingleCallCredentials { metadataGenerator: [Function (anonymous)] },
  channelCredentials: SecureChannelCredentialsImpl {
    callCredentials: EmptyCallCredentials {},
    rootCerts: null,
    privateKey: null,
    certChain: null,
    verifyOptions: {},
    connectionOptions: { secureContext: [SecureContext] }
  }
}
[class ChannelCredentials]
SecureChannelCredentialsImpl {
  callCredentials: EmptyCallCredentials {},
  rootCerts: null,
  privateKey: null,
  certChain: null,
  verifyOptions: {},
  connectionOptions: { secureContext: SecureContext { context: SecureContext {} } }
}
[class ChannelCredentials]

По удалял по одной все зависимости, пытаясь найти где же может быть коллизия. Но это не помогло:(

Ivan Zuev and others added 17 commits January 13, 2022 16:09
# [2.0.0-alpha.4](v2.0.0-alpha.3...v2.0.0-alpha.4) (2022-01-13)

### Bug Fixes

* install long package ([7120858](7120858))
# [2.0.0-alpha.5](v2.0.0-alpha.4...v2.0.0-alpha.5) (2022-01-20)

### Features

* change package description ([e9ecf16](e9ecf16))
# [2.0.0-alpha.6](v2.0.0-alpha.5...v2.0.0-alpha.6) (2022-01-20)

### Bug Fixes

* set public access for npm package ([a68360d](a68360d))
Use exact versions for dependencies
# [2.0.0-alpha.7](v2.0.0-alpha.6...v2.0.0-alpha.7) (2022-01-20)

### Bug Fixes

* use exact versions of dependencies ([b564178](b564178))
@DavyJohnes DavyJohnes merged commit 8dc3835 into beta Jan 20, 2022
@yandex-cloud-bot
Copy link
Collaborator

🎉 This PR is included in version 2.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yandex-cloud-bot
Copy link
Collaborator

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants