From 09b790b8df9574ad8309cb99478679bbc0684687 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Tue, 26 Sep 2023 11:17:01 -0400 Subject: [PATCH 01/32] fix navbar for preview branch Signed-off-by: Hannah Hunter --- daprdocs/config.toml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index d28410be6..6ddde6577 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -1,5 +1,5 @@ # Site Configuration -baseURL = "https://v1-12.docs.dapr.io" +baseURL = "https://v1-13.docs.dapr.io" title = "Dapr Docs" theme = "docsy" disableFastRender = true @@ -168,20 +168,23 @@ offlineSearch = false github_repo = "https://github.com/dapr/docs" github_project_repo = "https://github.com/dapr/dapr" github_subdir = "daprdocs" -github_branch = "v1.11" +github_branch = "v1.13" # Versioning -version_menu = "v1.11 (latest)" -version = "v1.11" +version_menu = "v1.13 (preview)" +version = "v1.13" archived_version = false url_latest_version = "https://docs.dapr.io" [[params.versions]] - version = "v1.12 (preview)" + version = "v1.13 (preview)" + url = "https://v1-13.docs.dapr.io" +[[params.versions]] + version = "v1.12 (latest)" url = "#" [[params.versions]] - version = "v1.11 (latest)" - url = "https://docs.dapr.io" + version = "v1.11" + url = "https://v1-11.docs.dapr.io" [[params.versions]] version = "v1.10" url = "https://v1-10.docs.dapr.io" From 3055c7c8020537502eb7a8f8e4b61fe617c7edd4 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Thu, 12 Oct 2023 11:27:53 -0400 Subject: [PATCH 02/32] update workflow Signed-off-by: Hannah Hunter --- .../workflows/{website-v1-12.yml => website-v1-13.yml} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename .github/workflows/{website-v1-12.yml => website-v1-13.yml} (95%) diff --git a/.github/workflows/website-v1-12.yml b/.github/workflows/website-v1-13.yml similarity index 95% rename from .github/workflows/website-v1-12.yml rename to .github/workflows/website-v1-13.yml index a16d54978..a4c551116 100644 --- a/.github/workflows/website-v1-12.yml +++ b/.github/workflows/website-v1-13.yml @@ -1,13 +1,13 @@ -name: Azure Static Web App v1.12 +name: Azure Static Web App v1.13 on: push: branches: - - v1.12 + - v1.13 pull_request: types: [opened, synchronize, reopened, closed] branches: - - v1.12 + - v1.13 jobs: build_and_deploy_job: @@ -28,7 +28,7 @@ jobs: HUGO_ENV: production HUGO_VERSION: "0.100.2" with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_12 }} + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_13 }} repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) skip_deploy_on_missing_secrets: true action: "upload" @@ -49,6 +49,6 @@ jobs: id: closepullrequest uses: Azure/static-web-apps-deploy@v1 with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_12 }} + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_V1_13 }} skip_deploy_on_missing_secrets: true action: "close" From af705f1a880ac0442f61a7a9ca651c02cd6c5adb Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Thu, 12 Oct 2023 11:51:56 -0400 Subject: [PATCH 03/32] update website roote Signed-off-by: Hannah Hunter --- .github/workflows/website-root.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml index 1f8e503e4..6039e0715 100644 --- a/.github/workflows/website-root.yml +++ b/.github/workflows/website-root.yml @@ -4,11 +4,11 @@ on: workflow_dispatch: push: branches: - - v1.11 + - v1.13 pull_request: types: [opened, synchronize, reopened, closed] branches: - - v1.11 + - v1.13 concurrency: # Cancel the previously triggered build for only PR build. From 1e105d0b2f5e9b09c1879b1705addd9c6a8381cb Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Thu, 12 Oct 2023 12:29:02 -0400 Subject: [PATCH 04/32] try and fix navbar Signed-off-by: Hannah Hunter --- daprdocs/config.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 48b1f16e5..0e645e963 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -181,10 +181,7 @@ url_latest_version = "https://docs.dapr.io" url = "https://v1-13.docs.dapr.io" [[params.versions]] version = "v1.12 (latest)" - url = "#" -[[params.versions]] - version = "v1.11" - url = "https://v1-11.docs.dapr.io" + url = "https://docs.dapr.io" [[params.versions]] version = "v1.11" url = "https://v1-11.docs.dapr.io" From 0dde1beb6c1064836746870aae7c1956b52c66f6 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Thu, 12 Oct 2023 14:49:45 -0400 Subject: [PATCH 05/32] fix navbar Signed-off-by: Hannah Hunter --- daprdocs/config.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 0e645e963..83fa1daae 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -168,11 +168,11 @@ offlineSearch = false github_repo = "https://github.com/dapr/docs" github_project_repo = "https://github.com/dapr/dapr" github_subdir = "daprdocs" -github_branch = "v1.13" +github_branch = "v1.12" # Versioning -version_menu = "v1.13 (preview)" -version = "v1.13" +version_menu = "v1.12 (latest)" +version = "v1.12" archived_version = false url_latest_version = "https://docs.dapr.io" From 3a2f85e4ed44a321eeddbc593f102a3dc7426f76 Mon Sep 17 00:00:00 2001 From: greenie-msft <56556602+greenie-msft@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:42:13 -0700 Subject: [PATCH 06/32] Update config.toml (#3827) Signed-off-by: greenie-msft <56556602+greenie-msft@users.noreply.github.com> --- daprdocs/config.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 83fa1daae..959683fbf 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -171,14 +171,14 @@ github_subdir = "daprdocs" github_branch = "v1.12" # Versioning -version_menu = "v1.12 (latest)" -version = "v1.12" +version_menu = "v1.13 (preview)" +version = "v1.13" archived_version = false url_latest_version = "https://docs.dapr.io" [[params.versions]] version = "v1.13 (preview)" - url = "https://v1-13.docs.dapr.io" + url = "#" [[params.versions]] version = "v1.12 (latest)" url = "https://docs.dapr.io" From 3cc2f02bee19b010a93cee13a0ded5464fcbc969 Mon Sep 17 00:00:00 2001 From: greenie-msft <56556602+greenie-msft@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:34:41 -0700 Subject: [PATCH 07/32] Remove website root WF (#3829) --- .github/workflows/website-root.yml | 109 ----------------------------- 1 file changed, 109 deletions(-) delete mode 100644 .github/workflows/website-root.yml diff --git a/.github/workflows/website-root.yml b/.github/workflows/website-root.yml deleted file mode 100644 index 6039e0715..000000000 --- a/.github/workflows/website-root.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Azure Static Web App Root - -on: - workflow_dispatch: - push: - branches: - - v1.13 - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - v1.13 - -concurrency: - # Cancel the previously triggered build for only PR build. - group: website-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - build_and_deploy_job: - name: Build Hugo Website - if: github.event.action != 'closed' - runs-on: ubuntu-latest - env: - SWA_BASE: 'proud-bay-0e9e0e81e' - HUGO_ENV: production - steps: - - name: Checkout docs repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '14' - - name: Setup Hugo - uses: peaceiris/actions-hugo@v2.5.0 - with: - hugo-version: 0.102.3 - extended: true - - name: Setup Docsy - run: | - cd daprdocs - git submodule update --init --recursive - sudo npm install -D --save autoprefixer - sudo npm install -D --save postcss-cli - - name: Build Hugo Website - run: | - cd daprdocs - git config --global --add safe.directory /github/workspace - if [ $GITHUB_EVENT_NAME == 'pull_request' ]; then - STAGING_URL="https://${SWA_BASE}-${{github.event.number}}.westus2.azurestaticapps.net/" - fi - hugo ${STAGING_URL+-b "$STAGING_URL"} - - name: Deploy docs site - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: "upload" - app_location: "daprdocs/public/" - api_location: "daprdocs/public/" - output_location: "" - skip_app_build: true - skip_deploy_on_missing_secrets: true - - name: Upload Hugo artifacts - uses: actions/upload-artifact@v3 - with: - name: hugo_build - path: ./daprdocs/public/ - if-no-files-found: error - - close_staging_site: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROUD_BAY_0E9E0E81E }} - action: "close" - skip_deploy_on_missing_secrets: true - - algolia_index: - name: Index site for Algolia - if: github.event_name == 'push' - needs: ['build_and_deploy_job'] - runs-on: ubuntu-latest - env: - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_API_WRITE_KEY: ${{ secrets.ALGOLIA_API_WRITE_KEY }} - ALGOLIA_INDEX_NAME: daprdocs - steps: - - name: Checkout docs repo - uses: actions/checkout@v2 - with: - submodules: false - - name: Download Hugo artifacts - uses: actions/download-artifact@v3 - with: - name: hugo_build - path: site/ - - name: Install Python packages - run: | - pip install --upgrade bs4 - pip install --upgrade 'algoliasearch>=2.0,<3.0' - - name: Index site - run: python ./.github/scripts/algolia.py ./site From 5adcac925ab798583235ac003cd7a8c3d5a9b2a3 Mon Sep 17 00:00:00 2001 From: Amit Mor Date: Sun, 12 Nov 2023 21:48:17 +0200 Subject: [PATCH 08/32] SNS/SQS contention Signed-off-by: Amit Mor Signed-off-by: Amit Mor --- .../components-reference/supported-pubsub/setup-aws-snssqs.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md index 61b682901..0d316d5ae 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md @@ -133,6 +133,9 @@ When configuring the PubSub component with SQS dead-letter queues, the metadata When running the Dapr sidecar (`daprd`) with your application on EKS (AWS Kubernetes) node/pod already attached to an IAM policy defining access to AWS resources, you **must not** provide AWS access-key, secret-key, and tokens in the definition of the component spec. {{% /alert %}} +#### SNS/SQS Contention with Dapr + +Fundamentally, SNS aggregates messages from multiple publisher topics into a single SQS queue by creating SQS subscriptions to those topics. As a subscriber, the SNS/SQS PubSub component consumes messages from that sole SQS queue. However, like any SQS consumer, the component cannot selectively retrieve only messages published to specific SNS topics it is configured to subscribe to. This can result in the component receiving messages originating from topics without associated handlers. Typically this occurs during component initialization, if infrastructure subscriptions are ready before component subscription handlers, or during shutdown, if component handlers are removed before infrastructure subscriptions. Since this issue affects any SQS consumer of multiple SNS topics, the component cannot prevent consuming messages from topics lacking handlers. When this happens, the component logs an error indicating such messages were erroneously retrieved. ## Create an SNS/SQS instance From 58570f137ce1c5aecfb0e49fd1100cf4cfdfc185 Mon Sep 17 00:00:00 2001 From: Amit Mor Date: Mon, 13 Nov 2023 10:45:28 +0200 Subject: [PATCH 09/32] added recommendation Signed-off-by: Amit Mor Signed-off-by: Amit Mor --- .../supported-pubsub/setup-aws-snssqs.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md index 0d316d5ae..207b42fda 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md @@ -9,15 +9,16 @@ aliases: ## Component format -To set up AWS SNS/SQS pub/sub, create a component of type `pubsub.aws.snssqs`. +To set up AWS SNS/SQS pub/sub, create a component of type `pubsub.aws.snssqs`. By default, the AWS SNS/SQS component: + - Generates the SNS topics - Provisions the SQS queues - Configures a subscription of the queues to the topics {{% alert title="Note" color="primary" %}} -If you only have a publisher and no subscriber, only the SNS topics are created. +If you only have a publisher and no subscriber, only the SNS topics are created. However, if you have a subscriber, SNS, SQS, and the dynamic or static subscription thereof are generated. {{% /alert %}} @@ -136,6 +137,11 @@ When running the Dapr sidecar (`daprd`) with your application on EKS (AWS Kubern #### SNS/SQS Contention with Dapr Fundamentally, SNS aggregates messages from multiple publisher topics into a single SQS queue by creating SQS subscriptions to those topics. As a subscriber, the SNS/SQS PubSub component consumes messages from that sole SQS queue. However, like any SQS consumer, the component cannot selectively retrieve only messages published to specific SNS topics it is configured to subscribe to. This can result in the component receiving messages originating from topics without associated handlers. Typically this occurs during component initialization, if infrastructure subscriptions are ready before component subscription handlers, or during shutdown, if component handlers are removed before infrastructure subscriptions. Since this issue affects any SQS consumer of multiple SNS topics, the component cannot prevent consuming messages from topics lacking handlers. When this happens, the component logs an error indicating such messages were erroneously retrieved. +In these situations, the unhandled messages would reappear in SQS with their [receive count](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html#sqs-receive-count) decremented after each pull. Thus, there is a risk that an unhandled message could exceed its `messageReceiveLimit` and be lost. + +{{% alert title="Important" color="warning" %}} +It is therefore advisable to consider potential contention scenarios when using SNS/SQS with Dapr, and configure `messageReceiveLimit` appropriately. It is also highly recommended to use SQS dead-letter queues by setting `sqsDeadLettersQueueName` to prevent losing messages. +{{% /alert %}} ## Create an SNS/SQS instance From 6a9ccf472911e19fa294772040207eeafee0b471 Mon Sep 17 00:00:00 2001 From: Amit Mor Date: Tue, 14 Nov 2023 23:45:15 +0200 Subject: [PATCH 10/32] suggested edits Signed-off-by: Amit Mor Signed-off-by: Amit Mor --- .../supported-pubsub/setup-aws-snssqs.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md index 207b42fda..6ccddb052 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-aws-snssqs.md @@ -136,11 +136,19 @@ When running the Dapr sidecar (`daprd`) with your application on EKS (AWS Kubern #### SNS/SQS Contention with Dapr -Fundamentally, SNS aggregates messages from multiple publisher topics into a single SQS queue by creating SQS subscriptions to those topics. As a subscriber, the SNS/SQS PubSub component consumes messages from that sole SQS queue. However, like any SQS consumer, the component cannot selectively retrieve only messages published to specific SNS topics it is configured to subscribe to. This can result in the component receiving messages originating from topics without associated handlers. Typically this occurs during component initialization, if infrastructure subscriptions are ready before component subscription handlers, or during shutdown, if component handlers are removed before infrastructure subscriptions. Since this issue affects any SQS consumer of multiple SNS topics, the component cannot prevent consuming messages from topics lacking handlers. When this happens, the component logs an error indicating such messages were erroneously retrieved. +Fundamentally, SNS aggregates messages from multiple publisher topics into a single SQS queue by creating SQS subscriptions to those topics. As a subscriber, the SNS/SQS pub/sub component consumes messages from that sole SQS queue. + +However, like any SQS consumer, the component cannot selectively retrieve the messages published to the SNS topics to which it is specifically subscribed. This can result in the component receiving messages originating from topics without associated handlers. Typically, this occurs during: + +- **Component initialization:** If infrastructure subscriptions are ready before component subscription handlers, or +- **Shutdown:** If component handlers are removed before infrastructure subscriptions. + +Since this issue affects any SQS consumer of multiple SNS topics, the component cannot prevent consuming messages from topics lacking handlers. When this happens, the component logs an error indicating such messages were erroneously retrieved. + In these situations, the unhandled messages would reappear in SQS with their [receive count](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html#sqs-receive-count) decremented after each pull. Thus, there is a risk that an unhandled message could exceed its `messageReceiveLimit` and be lost. {{% alert title="Important" color="warning" %}} -It is therefore advisable to consider potential contention scenarios when using SNS/SQS with Dapr, and configure `messageReceiveLimit` appropriately. It is also highly recommended to use SQS dead-letter queues by setting `sqsDeadLettersQueueName` to prevent losing messages. +Consider potential contention scenarios when using SNS/SQS with Dapr, and configure `messageReceiveLimit` appropriately. It is highly recommended to use SQS dead-letter queues by setting `sqsDeadLettersQueueName` to prevent losing messages. {{% /alert %}} ## Create an SNS/SQS instance From 9be31d97d0f7ed5fec71e78e31a3f00de1fc1df9 Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Tue, 21 Nov 2023 23:14:31 -0800 Subject: [PATCH 11/32] Update config.toml (#3882) Signed-off-by: Yaron Schneider --- daprdocs/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index c5f2f7bee..9b7e85bb2 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -190,7 +190,7 @@ url_latest_version = "https://docs.dapr.io" [[params.versions]] version = "v1.13 (preview)" - url = "#" + url = "https://v1-13.docs.dapr.io" [[params.versions]] version = "v1.12 (latest)" url = "#" From 02a84b0d6a230bb18395b671ead2c45ca00f57de Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Tue, 21 Nov 2023 23:47:16 -0800 Subject: [PATCH 12/32] Update config.toml (#3883) * Update config.toml Signed-off-by: Yaron Schneider * Update config.toml Signed-off-by: Yaron Schneider --------- Signed-off-by: Yaron Schneider --- daprdocs/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/config.toml b/daprdocs/config.toml index 9b7e85bb2..415e86f5f 100644 --- a/daprdocs/config.toml +++ b/daprdocs/config.toml @@ -190,10 +190,10 @@ url_latest_version = "https://docs.dapr.io" [[params.versions]] version = "v1.13 (preview)" - url = "https://v1-13.docs.dapr.io" + url = "#" [[params.versions]] version = "v1.12 (latest)" - url = "#" + url = "https://docs.dapr.io" [[params.versions]] version = "v1.11" url = "https://v1-11.docs.dapr.io" From 3114f4d357468752055901dd6d47f12e85f22a64 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Mon, 4 Dec 2023 23:39:25 +0000 Subject: [PATCH 13/32] Adds Daprd `--block-shutdown-seconds` reference Part of https://github.com/dapr/dapr/issues/4313 Signed-off-by: joshvanl --- daprdocs/content/en/reference/arguments-annotations-overview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index 68eab9812..599ae8eed 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -46,6 +46,7 @@ This table is meant to help users understand the equivalent options for running | `--sentry-address` | `--sentry-address` | | not supported | Address for the [Sentry CA service]({{< ref sentry >}}) | | `--version` | `--version` | `-v` | not supported | Prints the runtime version | | `--dapr-graceful-shutdown-seconds` | not supported | | `dapr.io/graceful-shutdown-seconds` | Graceful shutdown duration in seconds for Dapr, the maximum duration before forced shutdown when waiting for all in-progress requests to complete. Defaults to `5`. If you are running in Kubernetes mode, this value should not be larger than the Kubernetes termination grace period, who's default value is `30`.| +| `--dapr-block-shutdown-seconds` | not supported | | `dapr.io/block-shutdown-seconds` | Block shutdowns seconds, if set, will block the graceful shutdown proceedure as described above from starting until the number of seconds has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications which need to execute Dapr APIs during their own termination procudure. Any new invocations of any Dapr APIs will not be available to the application once the block has expired. | | not supported | not supported | | `dapr.io/enabled` | Setting this paramater to true injects the Dapr sidecar into the pod | | not supported | not supported | | `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based API authentication]({{< ref api-token >}}). By default this is not set | | not supported | not supported | | `dapr.io/app-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based application authentication]({{< ref app-api-token >}}). By default, this is not set | From 22b7057aed775fae3346cce77d1aaafbd51070ca Mon Sep 17 00:00:00 2001 From: joshvanl Date: Tue, 5 Dec 2023 14:08:08 +0000 Subject: [PATCH 14/32] Updates block-shutdown-seconds to block-shutdown-duration Signed-off-by: joshvanl --- daprdocs/content/en/reference/arguments-annotations-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index 599ae8eed..e2d0e4382 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -46,7 +46,7 @@ This table is meant to help users understand the equivalent options for running | `--sentry-address` | `--sentry-address` | | not supported | Address for the [Sentry CA service]({{< ref sentry >}}) | | `--version` | `--version` | `-v` | not supported | Prints the runtime version | | `--dapr-graceful-shutdown-seconds` | not supported | | `dapr.io/graceful-shutdown-seconds` | Graceful shutdown duration in seconds for Dapr, the maximum duration before forced shutdown when waiting for all in-progress requests to complete. Defaults to `5`. If you are running in Kubernetes mode, this value should not be larger than the Kubernetes termination grace period, who's default value is `30`.| -| `--dapr-block-shutdown-seconds` | not supported | | `dapr.io/block-shutdown-seconds` | Block shutdowns seconds, if set, will block the graceful shutdown proceedure as described above from starting until the number of seconds has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications which need to execute Dapr APIs during their own termination procudure. Any new invocations of any Dapr APIs will not be available to the application once the block has expired. | +| `--dapr-block-shutdown-duration` | not supported | | `dapr.io/block-shutdown-duration` | Block shutdown duration, if set, will block the graceful shutdown proceedure as described above from starting until the given duration has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications which need to execute Dapr APIs during their own termination procudure. Any new invocations of any Dapr APIs will not be available to the application once the block has expired. Accepts [Go duration](https://pkg.go.dev/time#ParseDuration) string. | | not supported | not supported | | `dapr.io/enabled` | Setting this paramater to true injects the Dapr sidecar into the pod | | not supported | not supported | | `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based API authentication]({{< ref api-token >}}). By default this is not set | | not supported | not supported | | `dapr.io/app-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based application authentication]({{< ref app-api-token >}}). By default, this is not set | From 2db304e62afc71faf58c4332483303ae20ed8242 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Fri, 8 Dec 2023 17:53:36 +0000 Subject: [PATCH 15/32] Update arguments-annotations-overview.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/reference/arguments-annotations-overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/arguments-annotations-overview.md b/daprdocs/content/en/reference/arguments-annotations-overview.md index e2d0e4382..f69190fcf 100644 --- a/daprdocs/content/en/reference/arguments-annotations-overview.md +++ b/daprdocs/content/en/reference/arguments-annotations-overview.md @@ -46,7 +46,7 @@ This table is meant to help users understand the equivalent options for running | `--sentry-address` | `--sentry-address` | | not supported | Address for the [Sentry CA service]({{< ref sentry >}}) | | `--version` | `--version` | `-v` | not supported | Prints the runtime version | | `--dapr-graceful-shutdown-seconds` | not supported | | `dapr.io/graceful-shutdown-seconds` | Graceful shutdown duration in seconds for Dapr, the maximum duration before forced shutdown when waiting for all in-progress requests to complete. Defaults to `5`. If you are running in Kubernetes mode, this value should not be larger than the Kubernetes termination grace period, who's default value is `30`.| -| `--dapr-block-shutdown-duration` | not supported | | `dapr.io/block-shutdown-duration` | Block shutdown duration, if set, will block the graceful shutdown proceedure as described above from starting until the given duration has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications which need to execute Dapr APIs during their own termination procudure. Any new invocations of any Dapr APIs will not be available to the application once the block has expired. Accepts [Go duration](https://pkg.go.dev/time#ParseDuration) string. | +| `--dapr-block-shutdown-duration` | not supported | | `dapr.io/block-shutdown-duration` | Block shutdown duration, if set, blocks the graceful shutdown procedure (as described above) from starting until the given duration has elapsed or the application becomes unhealthy as configured through application health options. This is useful for applications that need to execute Dapr APIs during their own termination procedure. Any new invocations of any Dapr APIs are not available to the application once the block has expired. Accepts [Go duration](https://pkg.go.dev/time#ParseDuration) string. | | not supported | not supported | | `dapr.io/enabled` | Setting this paramater to true injects the Dapr sidecar into the pod | | not supported | not supported | | `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based API authentication]({{< ref api-token >}}). By default this is not set | | not supported | not supported | | `dapr.io/app-token-secret` | Tells Dapr which Kubernetes secret to use for [token-based application authentication]({{< ref app-api-token >}}). By default, this is not set | From 6998990686b014fcefcfcc4a62cd9e407a02ec9f Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Tue, 19 Dec 2023 00:32:03 +0000 Subject: [PATCH 16/32] Adds a general docs/reference page for the richer error model Signed-off-by: Elena Kolevska --- .../content/en/reference/errors/_index.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 daprdocs/content/en/reference/errors/_index.md diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md new file mode 100644 index 000000000..264f086f9 --- /dev/null +++ b/daprdocs/content/en/reference/errors/_index.md @@ -0,0 +1,89 @@ +--- +type: docs +title: Dapr Errors +linkTitle: "Dapr Errors" +weight: 700 +description: "Information on Dapr errors and how to handle them" +--- + +# Dapr Error Handling: Understanding the Error Models + +Initially, Dapr followed the standard gRPC error model. However, to provide more detailed and informative error messages, Dapr is transitioning to a richer error model as defined by gRPC. + +### Standard gRPC Error Model + +The [standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is a straightforward approach to error reporting gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. + +Example of a Standard gRPC Error Response: +``` +ERROR: + Code: InvalidArgument + Message: input key/keyPrefix 'bad||keyname' can't contain '||' +``` + +### Richer gRPC Error Model + +The richer error model enhances the standard model by providing additional context and details about the error. This model includes the standard error code and message, along with a Details section that can contain various types of information, such as ErrorInfo, ResourceInfo, and BadRequest details. + +**Example of a Richer gRPC Error Response:** +``` +ERROR: + Code: InvalidArgument + Message: input key/keyPrefix 'bad||keyname' can't contain '||' + Details: + 1) { + "@type": "type.googleapis.com/google.rpc.ErrorInfo", + "domain": "dapr.io", + "reason": "DAPR_STATE_ILLEGAL_KEY" + } + 2) { + "@type": "type.googleapis.com/google.rpc.ResourceInfo", + "resourceName": "statestore", + "resourceType": "state" + } + 3) { + "@type": "type.googleapis.com/google.rpc.BadRequest", + "fieldViolations": [ + { + "field": "bad||keyname", + "description": "input key/keyPrefix 'bad||keyname' can't contain '||'" + } + ] + } +``` + +For HTTP clients, Dapr translates the gRPC error model to a similar structure in JSON format. The response includes an errorCode, a message, and a details array that mirrors the structure found in the richer gRPC model. + +**Example of an HTTP Error Response:** +```json +{ + "errorCode": "ERR_MALFORMED_REQUEST", + "message": "api error: code = InvalidArgument desc = input key/keyPrefix 'bad||keyname' can't contain '||'", + "details": [ + { + "@type": "type.googleapis.com/google.rpc.ErrorInfo", + "domain": "dapr.io", + "metadata": null, + "reason": "DAPR_STATE_ILLEGAL_KEY" + }, + { + "@type": "type.googleapis.com/google.rpc.ResourceInfo", + "description": "", + "owner": "", + "resource_name": "statestore", + "resource_type": "state" + }, + { + "@type": "type.googleapis.com/google.rpc.BadRequest", + "field_violations": [ + { + "field": "bad||keyname", + "description": "api error: code = InvalidArgument desc = input key/keyPrefix 'bad||keyname' can't contain '||'" + } + ] + } + ] +} +``` + +You can find the specification of all the possible status details [here](https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto). \ No newline at end of file From 992cd5be99071de61d0a9e4c10d4c5c9c29d52e0 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Tue, 19 Dec 2023 00:42:08 +0000 Subject: [PATCH 17/32] Adds a note about not all errors being enriched Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index 264f086f9..58c4e7c8e 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -8,7 +8,9 @@ description: "Information on Dapr errors and how to handle them" # Dapr Error Handling: Understanding the Error Models -Initially, Dapr followed the standard gRPC error model. However, to provide more detailed and informative error messages, Dapr is transitioning to a richer error model as defined by gRPC. +Initially, Dapr followed the standard gRPC error model. However, to provide more detailed and informative error messages, Dapr is gradually transitioning to a richer error model as defined by gRPC. + +> Not all Dapr errors have been converted to the richer gRPC error model. ### Standard gRPC Error Model @@ -25,6 +27,7 @@ ERROR: The richer error model enhances the standard model by providing additional context and details about the error. This model includes the standard error code and message, along with a Details section that can contain various types of information, such as ErrorInfo, ResourceInfo, and BadRequest details. + **Example of a Richer gRPC Error Response:** ``` ERROR: From 3dd8edee51a7d9f0202182a214126e8b9f4117d8 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Tue, 19 Dec 2023 16:40:55 +0000 Subject: [PATCH 18/32] Component Hot Reloading Adds documentation for Component Hot Reloading Part of https://github.com/dapr/dapr/issues/1172 Signed-off-by: joshvanl --- daprdocs/content/en/concepts/components-concept.md | 8 ++++++++ .../en/operations/support/support-preview-features.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index b7248d656..986682076 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -52,6 +52,14 @@ For example: For more information read [Pluggable components overview]({{< ref "pluggable-components-overview" >}}) +## Hot Reloading + +With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), Components are able to be "hot reloaded" at runtime. +This means that you can update component configuration without restarting the Dapr runtime. +Component reloading happens when a Component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +When a component is updated, the Component is first closed, and then reinitialized using the new configuration. +There will be a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. + ## Available component types The following are the component types provided by Dapr: diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index 9c9fff690..b62ea901e 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | - +| ** Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self Hosted mode.| N/A | [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From 4822030d6a6fa4f37390a67ecc1d9afceac56fb3 Mon Sep 17 00:00:00 2001 From: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Date: Thu, 4 Jan 2024 15:44:51 -0500 Subject: [PATCH 19/32] Submodules into 1.13 (#3927) * javascript submodule for 1.13 Signed-off-by: Hannah Hunter * go submodules into 1.13 Signed-off-by: Hannah Hunter * java submodules into 1.13 Signed-off-by: Hannah Hunter * dotnet submodules for 1.13 Signed-off-by: Hannah Hunter * python submodule Signed-off-by: Hannah Hunter --------- Signed-off-by: Hannah Hunter Co-authored-by: Mark Fussell --- sdkdocs/dotnet | 2 +- sdkdocs/go | 2 +- sdkdocs/java | 2 +- sdkdocs/js | 2 +- sdkdocs/python | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sdkdocs/dotnet b/sdkdocs/dotnet index 99d874a2b..10ef81873 160000 --- a/sdkdocs/dotnet +++ b/sdkdocs/dotnet @@ -1 +1 @@ -Subproject commit 99d874a2b138af020df099a0fc0a09a7d0597fae +Subproject commit 10ef81873b3448fb136c73ad26a9fd2768954c2f diff --git a/sdkdocs/go b/sdkdocs/go index e16e0350a..04f7b595b 160000 --- a/sdkdocs/go +++ b/sdkdocs/go @@ -1 +1 @@ -Subproject commit e16e0350a52349b5a05138edc0b58e3be78ee753 +Subproject commit 04f7b595b6d19bbf1c42a3364992016c3ae3e40e diff --git a/sdkdocs/java b/sdkdocs/java index 5e45aa86b..6759f19f8 160000 --- a/sdkdocs/java +++ b/sdkdocs/java @@ -1 +1 @@ -Subproject commit 5e45aa86b81748bf1e6efdbf7f52c20645a12435 +Subproject commit 6759f19f8374c7c550c709b1fe8118ce738280a8 diff --git a/sdkdocs/js b/sdkdocs/js index df7eff281..6e89215f5 160000 --- a/sdkdocs/js +++ b/sdkdocs/js @@ -1 +1 @@ -Subproject commit df7eff281a5a1395a7967c658a5707e8dfb2b99e +Subproject commit 6e89215f5ca26f8f4d109424e2cad7792b9d8a28 diff --git a/sdkdocs/python b/sdkdocs/python index 6171b67db..c08e71494 160000 --- a/sdkdocs/python +++ b/sdkdocs/python @@ -1 +1 @@ -Subproject commit 6171b67db60d51704ed8425ae71dda9226bf1255 +Subproject commit c08e71494a644f9ff875941c669c6a1e1f3a3340 From 1a24364b3484e150ee7e4e47df9d8c4c78c3a920 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Tue, 9 Jan 2024 13:37:19 +0000 Subject: [PATCH 20/32] Apply suggestions from code review Co-authored-by: Mark Fussell Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index 986682076..48365186d 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -54,11 +54,11 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com ## Hot Reloading -With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), Components are able to be "hot reloaded" at runtime. +With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. -Component reloading happens when a Component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. When a component is updated, the Component is first closed, and then reinitialized using the new configuration. -There will be a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. +There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. ## Available component types From 7271911f32d0e83101f55f2e2fb9e4426f83a66f Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Tue, 9 Jan 2024 13:37:50 +0000 Subject: [PATCH 21/32] Update daprdocs/content/en/concepts/components-concept.md Co-authored-by: Mark Fussell Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index 48365186d..db5122e0a 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -57,7 +57,7 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. -When a component is updated, the Component is first closed, and then reinitialized using the new configuration. +When a component is updated, the component is first closed, and then reinitialized using the new configuration. There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. ## Available component types From d00938488cc1d624dcbacd50c7a655cb703f39b2 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Tue, 9 Jan 2024 14:13:55 +0000 Subject: [PATCH 22/32] Update compoents-updates.md with hot reloading feature Signed-off-by: joshvanl --- .../en/operations/components/component-updates.md | 15 ++++++++++++--- .../support/support-preview-features.md | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index 583eee28e..eb5c51ef4 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -6,18 +6,27 @@ weight: 300 description: "Updating deployed components used by applications" --- -When making an update to an existing deployed component used by an application, Dapr does not update the component automatically. The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. How this done depends on the hosting environment. +When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the `HotReload` feature gate is enabled. +The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. +How this done depends on the hosting environment. + +{{% alert title="Note" color="primary" %}} +Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. +This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). +All component types are supported for hot reloading. +This feature is currently in preview. +{{% /alert %}} ## Kubernetes When running in Kubernetes, the process of updating a component involves two steps: 1. Applying the new component YAML to the desired namespace -2. Performing a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component +2. (Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}})), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component ## Self Hosted -When running in Self Hosted mode, the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. +Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. ## Further reading - [Components concept]({{< ref components-concept.md >}}) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index b62ea901e..c960c2e5f 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | -| ** Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self Hosted mode.| N/A | [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | +| **Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From accbf7b1118c5b7a862549e0a0682ff67c401f0f Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Wed, 10 Jan 2024 17:59:35 +0000 Subject: [PATCH 23/32] Apply suggestions from code review Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index 58c4e7c8e..4731a7cc9 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -1,22 +1,24 @@ --- type: docs -title: Dapr Errors -linkTitle: "Dapr Errors" +title: Dapr errors +linkTitle: "Dapr errors" weight: 700 description: "Information on Dapr errors and how to handle them" --- -# Dapr Error Handling: Understanding the Error Models +## Dapr Error Handling: Understanding the Error Models Initially, Dapr followed the standard gRPC error model. However, to provide more detailed and informative error messages, Dapr is gradually transitioning to a richer error model as defined by gRPC. -> Not all Dapr errors have been converted to the richer gRPC error model. +{{% alert title="Note" color="primary" %}} +Not all Dapr errors have been converted to the richer gRPC error model. +{{% /alert %}} ### Standard gRPC Error Model The [standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is a straightforward approach to error reporting gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. -Example of a Standard gRPC Error Response: +**Example of a Standard gRPC Error Response:** ``` ERROR: Code: InvalidArgument @@ -25,7 +27,7 @@ ERROR: ### Richer gRPC Error Model -The richer error model enhances the standard model by providing additional context and details about the error. This model includes the standard error code and message, along with a Details section that can contain various types of information, such as ErrorInfo, ResourceInfo, and BadRequest details. +The richer error model enhances the standard model by providing additional context and details about the error. This model includes the standard error code and message, along with a `Details` section that can contain various types of information, such as `ErrorInfo`, `ResourceInfo`, and `BadRequest` details. **Example of a Richer gRPC Error Response:** @@ -55,7 +57,7 @@ ERROR: } ``` -For HTTP clients, Dapr translates the gRPC error model to a similar structure in JSON format. The response includes an errorCode, a message, and a details array that mirrors the structure found in the richer gRPC model. +For HTTP clients, Dapr translates the gRPC error model to a similar structure in JSON format. The response includes an `errorCode`, a `message`, and a `details` array that mirrors the structure found in the richer gRPC model. **Example of an HTTP Error Response:** ```json From afec1f1d58780f9ecc2a996b716a52849d86ecb5 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Thu, 11 Jan 2024 11:52:36 +0000 Subject: [PATCH 24/32] Apply suggestions from code review Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 4 ++-- .../content/en/operations/components/component-updates.md | 8 ++++---- .../en/operations/support/support-preview-features.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index db5122e0a..cb2f9e7ec 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -56,9 +56,9 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. -Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +Component reloading occurs when a component resource is created, updated, or deleted, either in the Kubernetes API or in self-hosted mode when a file is changed in the `resources` directory. When a component is updated, the component is first closed, and then reinitialized using the new configuration. -There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. +The component is unavailable for a short period of time during reload and reinitialization. ## Available component types diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index eb5c51ef4..7f6dd5078 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -8,7 +8,7 @@ description: "Updating deployed components used by applications" When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the `HotReload` feature gate is enabled. The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. -How this done depends on the hosting environment. +How this is done depends on the hosting environment. {{% alert title="Note" color="primary" %}} Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. @@ -21,12 +21,12 @@ This feature is currently in preview. When running in Kubernetes, the process of updating a component involves two steps: -1. Applying the new component YAML to the desired namespace -2. (Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}})), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component +1. Apply the new component YAML to the desired namespace +1. Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component ## Self Hosted -Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. +Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping and restarting the `daprd` process to pick up the latest component. ## Further reading - [Components concept]({{< ref components-concept.md >}}) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index c960c2e5f..cd7fa4991 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | -| **Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | +| **Component Hot Reloading** | Allows for Dapr-loaded components to be "hot reloaded". A component spec is reloaded when it is created/updated/deleted in Kubernetes or on file when running in self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From be597e9b356713dcbbf7f26d668411bbf383fb20 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Thu, 11 Jan 2024 11:52:51 +0000 Subject: [PATCH 25/32] Update daprdocs/content/en/operations/components/component-updates.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/operations/components/component-updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index 7f6dd5078..fb8a9313c 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -11,7 +11,7 @@ The Dapr sidecar needs to be restarted in order to pick up the latest version of How this is done depends on the hosting environment. {{% alert title="Note" color="primary" %}} -Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. +Dapr can be made to "hot reload" components, where updates are picked up automatically without needing a restart. This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). All component types are supported for hot reloading. This feature is currently in preview. From 3a676db51ab1c22326398fd452272c1b8b32255f Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Fri, 12 Jan 2024 11:44:00 +0000 Subject: [PATCH 26/32] Apply suggestions from code review Co-authored-by: Mark Fussell Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index 4731a7cc9..c73d81368 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -16,7 +16,7 @@ Not all Dapr errors have been converted to the richer gRPC error model. ### Standard gRPC Error Model -The [standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is a straightforward approach to error reporting gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. +The [standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is an approach to error reporting in gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. **Example of a Standard gRPC Error Response:** ``` From ae4e13754b46c86f4aff55419f3fab06b2be2eea Mon Sep 17 00:00:00 2001 From: Patrick Assuied Date: Fri, 12 Jan 2024 11:25:17 -0800 Subject: [PATCH 27/32] Feature/add-kafka-pubsub-schema-registry (#3946) * Added doc for kafka pubsub Avro schema registry support Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Patrick Assuied * Update setup-apache-kafka.md Signed-off-by: Patrick Assuied * Update daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md Co-authored-by: Mark Fussell Signed-off-by: Patrick Assuied --------- Signed-off-by: Patrick Assuied Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Co-authored-by: Mark Fussell --- .../supported-bindings/kafka.md | 15 +++ .../supported-pubsub/setup-apache-kafka.md | 112 ++++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/daprdocs/content/en/reference/components-reference/supported-bindings/kafka.md b/daprdocs/content/en/reference/components-reference/supported-bindings/kafka.md index 43f030799..510e73c2d 100644 --- a/daprdocs/content/en/reference/components-reference/supported-bindings/kafka.md +++ b/daprdocs/content/en/reference/components-reference/supported-bindings/kafka.md @@ -49,6 +49,16 @@ spec: value: "2.0.0" - name: direction value: "input, output" + - name: schemaRegistryURL # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry URL. + value: http://localhost:8081 + - name: schemaRegistryAPIKey # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry API Key. + value: XYAXXAZ + - name: schemaRegistryAPISecret # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Secret. + value: "ABCDEFGMEADFF" + - name: schemaCachingEnabled # Optional. When using Schema Registry Avro serialization/deserialization. Enables caching for schemas. + value: true + - name: schemaLatestVersionCacheTTL # Optional. When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available. + value: 5m ``` ## Spec metadata fields @@ -75,6 +85,11 @@ spec: | `version` | N | Input/Output | Kafka cluster version. Defaults to 2.0.0. Please note that this needs to be mandatorily set to `1.0.0` for EventHubs with Kafka. | `"1.0.0"` | | `direction` | N | Input/Output | The direction of the binding. | `"input"`, `"output"`, `"input, output"` | | `oidcExtensions` | N | Input/Output | String containing a JSON-encoded dictionary of OAuth2/OIDC extensions to request with the access token | `{"cluster":"kafka","poolid":"kafkapool"}` | +| `schemaRegistryURL` | N | Required when using Schema Registry Avro serialization/deserialization. The Schema Registry URL. | `http://localhost:8081` | +| `schemaRegistryAPIKey` | N | When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Key. | `XYAXXAZ` | +| `schemaRegistryAPISecret` | N | When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Secret. | `ABCDEFGMEADFF` | +| `schemaCachingEnabled` | N | When using Schema Registry Avro serialization/deserialization. Enables caching for schemas. Default is `true` | `true` | +| `schemaLatestVersionCacheTTL` | N | When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available. Default is 5 min | `5m` | #### Note The metadata `version` must be set to `1.0.0` when using Azure EventHubs with Kafka. diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md index 05ff83520..7c39f01af 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md @@ -49,6 +49,17 @@ spec: value: 2.0.0 - name: disableTls # Optional. Disable TLS. This is not safe for production!! You should read the `Mutual TLS` section for how to use TLS. value: "true" + - name: schemaRegistryURL # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry URL. + value: http://localhost:8081 + - name: schemaRegistryAPIKey # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry API Key. + value: XYAXXAZ + - name: schemaRegistryAPISecret # Optional. When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Secret. + value: "ABCDEFGMEADFF" + - name: schemaCachingEnabled # Optional. When using Schema Registry Avro serialization/deserialization. Enables caching for schemas. + value: true + - name: schemaLatestVersionCacheTTL # Optional. When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available. + value: 5m + ``` > For details on using `secretKeyRef`, see the guide on [how to reference secrets in components]({{< ref component-secrets.md >}}). @@ -81,6 +92,11 @@ spec: | oidcClientSecret | N | The OAuth2 client secret that has been provisioned in the identity provider: Required when `authType` is set to `oidc` | `"KeFg23!"` | | oidcScopes | N | Comma-delimited list of OAuth2/OIDC scopes to request with the access token. Recommended when `authType` is set to `oidc`. Defaults to `"openid"` | `"openid,kafka-prod"` | | oidcExtensions | N | Input/Output | String containing a JSON-encoded dictionary of OAuth2/OIDC extensions to request with the access token | `{"cluster":"kafka","poolid":"kafkapool"}` | +| schemaRegistryURL | N | Required when using Schema Registry Avro serialization/deserialization. The Schema Registry URL. | `http://localhost:8081` | +| schemaRegistryAPIKey | N | When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Key. | `XYAXXAZ` | +| schemaRegistryAPISecret | N | When using Schema Registry Avro serialization/deserialization. The Schema Registry credentials API Secret. | `ABCDEFGMEADFF` | +| schemaCachingEnabled | N | When using Schema Registry Avro serialization/deserialization. Enables caching for schemas. Default is `true` | `true` | +| schemaLatestVersionCacheTTL | N | When using Schema Registry Avro serialization/deserialization. The TTL for schema caching when publishing a message with latest schema available. Default is 5 min | `5m` | The `secretKeyRef` above is referencing a [kubernetes secrets store]({{< ref kubernetes-secret-store.md >}}) to access the tls information. Visit [here]({{< ref setup-secret-store.md >}}) to learn more about how to configure a secret store component. @@ -348,6 +364,102 @@ curl -X POST http://localhost:3500/v1.0/publish/myKafka/myTopic?metadata.correla }' ``` +## Avro Schema Registry serialization/deserialization +You can configure pub/sub to publish or consume data encoded using [Avro binary serialization](https://avro.apache.org/docs/), leveraging an [Apache Schema Registry](https://developer.confluent.io/courses/apache-kafka/schema-registry/) (for example, [Confluent Schema Registry](https://developer.confluent.io/courses/apache-kafka/schema-registry/), [Apicurio](https://www.apicur.io/registry/)). + +### Configuration + +{{% alert title="Important" color="warning" %}} +Currently, only message value serialization/deserialization is supported. Since cloud events are not supported, the `rawPayload=true` metadata must be passed. +{{% /alert %}} + +When configuring the Kafka pub/sub component metadata, you must define: +- The schema registry URL +- The API key/secret, if applicable + +Schema subjects are automatically derived from topic names, using the standard naming convention. For example, for a topic named `my-topic`, the schema subject will be `my-topic-value`. +When interacting with the message payload within the service, it is in JSON format. The payload is transparently serialized/deserialized within the Dapr component. +Date/Datetime fields must be passed as their [Epoch Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) equivalent (rather than typical Iso8601). For example: +- `2024-01-10T04:36:05.986Z` should be passed as `1704861365986` (the number of milliseconds since Jan 1st, 1970) +- `2024-01-10` should be passed as `19732` (the number of days since Jan 1st, 1970) + +### Publishing Avro messages +In order to indicate to the Kafka pub/sub component that the message should be using Avro serialization, the `valueSchemaType` metadata must be set to `Avro`. + +{{< tabs curl "Python SDK">}} + +{{% codetab %}} +```bash +curl -X "POST" http://localhost:3500/v1.0/publish/pubsub/my-topic?metadata.rawPayload=true&metadata.valueSchemaType=Avro -H "Content-Type: application/json" -d '{"order_number": "345", "created_date": 1704861365986}' +``` +{{% /codetab %}} + +{{% codetab %}} +```python +from dapr.clients import DaprClient + +with DaprClient() as d: + req_data = { + 'order_number': '345', + 'created_date': 1704861365986 + } + # Create a typed message with content type and body + resp = d.publish_event( + pubsub_name='pubsub', + topic_name='my-topic', + data=json.dumps(req_data), + publish_metadata={'rawPayload': 'true', 'valueSchemaType': 'Avro'} + ) + # Print the request + print(req_data, flush=True) +``` +{{% /codetab %}} + +{{< /tabs >}} + + +### Subscribing to Avro topics +In order to indicate to the Kafka pub/sub component that the message should be deserialized using Avro, the `valueSchemaType` metadata must be set to `Avro` in the subscription metadata. + +{{< tabs "Python (FastAPI)" >}} + +{{% codetab %}} + +```python +from fastapi import APIRouter, Body, Response, status +import json +import sys + +app = FastAPI() + +router = APIRouter() + + +@router.get('/dapr/subscribe') +def subscribe(): + subscriptions = [{'pubsubname': 'pubsub', + 'topic': 'my-topic', + 'route': 'my_topic_subscriber', + 'metadata': { + 'rawPayload': 'true', + 'valueSchemaType': 'Avro', + } }] + return subscriptions + +@router.post('/my_topic_subscriber') +def my_topic_subscriber(event_data=Body()): + print(event_data, flush=True) + return Response(status_code=status.HTTP_200_OK) +``` + +app.include_router(router) + +{{% /codetab %}} + +{{< /tabs >}} + + + ## Create a Kafka instance {{< tabs "Self-Hosted" "Kubernetes">}} From b0dafe0897e4ae9332475f781de9f25d54f840be Mon Sep 17 00:00:00 2001 From: Patrick Assuied Date: Fri, 12 Jan 2024 13:03:21 -0800 Subject: [PATCH 28/32] fix formatting (#3950) Signed-off-by: Patrick Assuied --- .../supported-pubsub/setup-apache-kafka.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md index 7c39f01af..ad1fa1e3b 100644 --- a/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md +++ b/daprdocs/content/en/reference/components-reference/supported-pubsub/setup-apache-kafka.md @@ -450,10 +450,11 @@ def subscribe(): def my_topic_subscriber(event_data=Body()): print(event_data, flush=True) return Response(status_code=status.HTTP_200_OK) -``` app.include_router(router) +``` + {{% /codetab %}} {{< /tabs >}} From d71bd4b81c3b1583c1166c18f32f072c17d3f28b Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Tue, 23 Jan 2024 15:55:41 +0000 Subject: [PATCH 29/32] Apply suggestions from code review Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index c73d81368..54ce54cd6 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -8,7 +8,7 @@ description: "Information on Dapr errors and how to handle them" ## Dapr Error Handling: Understanding the Error Models -Initially, Dapr followed the standard gRPC error model. However, to provide more detailed and informative error messages, Dapr is gradually transitioning to a richer error model as defined by gRPC. +Initially, errors followed the [Standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model). However, to provide more detailed and informative error messages, an enhanced error model has been defined which aligns with the gRPC [Richer error model](https://grpc.io/docs/guides/error/#richer-error-model). {{% alert title="Note" color="primary" %}} Not all Dapr errors have been converted to the richer gRPC error model. From e16d22f79a44a96d750ee5ec2cebb9dec8b8d098 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Tue, 23 Jan 2024 16:13:36 +0000 Subject: [PATCH 30/32] Small fixes after review Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index 54ce54cd6..1411655af 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -6,7 +6,7 @@ weight: 700 description: "Information on Dapr errors and how to handle them" --- -## Dapr Error Handling: Understanding the Error Models +## Error handling: Understanding errors model and reporting Initially, errors followed the [Standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model). However, to provide more detailed and informative error messages, an enhanced error model has been defined which aligns with the gRPC [Richer error model](https://grpc.io/docs/guides/error/#richer-error-model). @@ -59,7 +59,7 @@ ERROR: For HTTP clients, Dapr translates the gRPC error model to a similar structure in JSON format. The response includes an `errorCode`, a `message`, and a `details` array that mirrors the structure found in the richer gRPC model. -**Example of an HTTP Error Response:** +**Example of an HTTP error response:** ```json { "errorCode": "ERR_MALFORMED_REQUEST", From 63858ae8e297b8aa232f08320c0eca5e1c4029fb Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Thu, 25 Jan 2024 16:11:29 +0000 Subject: [PATCH 31/32] Small update Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index 1411655af..dbe2d4874 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -16,7 +16,7 @@ Not all Dapr errors have been converted to the richer gRPC error model. ### Standard gRPC Error Model -The [standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is an approach to error reporting in gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. +The [Standard gRPC error model](https://grpc.io/docs/guides/error/#standard-error-model) is an approach to error reporting in gRPC. Each error response includes an error code and an error message. The error codes are standardized and reflect common error conditions. **Example of a Standard gRPC Error Response:** ``` @@ -27,7 +27,7 @@ ERROR: ### Richer gRPC Error Model -The richer error model enhances the standard model by providing additional context and details about the error. This model includes the standard error code and message, along with a `Details` section that can contain various types of information, such as `ErrorInfo`, `ResourceInfo`, and `BadRequest` details. +The [Richer gRPC error model](https://grpc.io/docs/guides/error/#richer-error-model) extends the standard error model by providing additional context and details about the error. This model includes the standard error `code` and `message`, along with a `details` section that can contain various types of information, such as `ErrorInfo`, `ResourceInfo`, and `BadRequest` details. **Example of a Richer gRPC Error Response:** From 29fc98bc145a4a8f762ca38ff9ade05c5a6f8b78 Mon Sep 17 00:00:00 2001 From: Elena Kolevska Date: Thu, 25 Jan 2024 21:21:43 +0000 Subject: [PATCH 32/32] Add related links Signed-off-by: Elena Kolevska --- daprdocs/content/en/reference/errors/_index.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/reference/errors/_index.md b/daprdocs/content/en/reference/errors/_index.md index dbe2d4874..35f685f74 100644 --- a/daprdocs/content/en/reference/errors/_index.md +++ b/daprdocs/content/en/reference/errors/_index.md @@ -91,4 +91,9 @@ For HTTP clients, Dapr translates the gRPC error model to a similar structure in } ``` -You can find the specification of all the possible status details [here](https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto). \ No newline at end of file +You can find the specification of all the possible status details [here](https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto). + +## Related Links + +- [Authoring error codes](https://github.com/dapr/dapr/tree/master/pkg/api/errors) +- [Using error codes in the Go SDK](https://docs.dapr.io/developing-applications/sdks/go/go-client/#error-handling)