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

webhook implementation #1373

Open
wants to merge 9 commits into
base: mvp_demo
Choose a base branch
from
Open

Conversation

msvinaykumar
Copy link
Contributor

@msvinaykumar msvinaykumar commented Nov 14, 2024

Description

The webhook parameter allows the system to notify an external service or consumer about the completion status of
an experiment-processing job. When a job is completed, this webhook will be triggered to send an HTTP request to a
predefined URL, configured either via an environment variable (webhookURL) or within a kruize configuration
file.
This notification mechanism is essential for systems that require real-time updates about the job's processing
status, enabling consumers to take immediate follow-up actions. For example, an external analytics dashboard, a
monitoring service, or a message queue like Kafka can listen for these webhook calls to further process or log the
job completion data.

Fixes # (issue)

Type of change

  • Bug fix
  • New feature
  • Docs update
  • Breaking change (What changes might users need to make in their application due to this PR?)
  • Requires DB changes

How has this been tested?

Please describe the tests that were run to verify your changes and steps to reproduce. Please specify any test configuration required.

  • New Test X
  • Functional testsuite

Test Configuration

  • Kubernetes clusters tested on:

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

Include any additional information such as links, test results, screenshots here

@msvinaykumar msvinaykumar added the kruize-local Tag for mentioning all the PR's and issues raised which covers the kruize local monitoring usecase label Nov 14, 2024
@msvinaykumar msvinaykumar added this to the Kruize 0.2 Release milestone Nov 14, 2024
@msvinaykumar msvinaykumar self-assigned this Nov 14, 2024
@dinogun
Copy link
Contributor

dinogun commented Nov 15, 2024

@msvinaykumar I think the implementation is unnecessarily adding complexity. What we need is to embed the webhook as part of the Bulk API itself.

{
  "filter": {
    "exclude": {
      "namespace": [],
      "workload": [],
      "containers": [],
      "labels": {}
    },
    "include": {
      "namespace": [],
      "workload": [],
      "containers": [],
      "labels": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  },
  "time_range": {},
  "datasource": "prometheus-1",
  "experiment_types": [
    "container",
    "namespace"
  ]
  "webhooks": {
      "default": "http://URL:PORT/bulkAPIDefaultWebhook",
      "Error": ""http://URL:PORT/bulkAPIErrorWebhook"
  }
}

Also what gets posted on the Webhook is the BulkAPI response as-is.

@dinogun
Copy link
Contributor

dinogun commented Nov 15, 2024

@msvinaykumar Please fix the conflicts

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
@msvinaykumar
Copy link
Contributor Author

@msvinaykumar I think the implementation is unnecessarily adding complexity. What we need is to embed the webhook as part of the Bulk API itself.

{
  "filter": {
    "exclude": {
      "namespace": [],
      "workload": [],
      "containers": [],
      "labels": {}
    },
    "include": {
      "namespace": [],
      "workload": [],
      "containers": [],
      "labels": {
        "key1": "value1",
        "key2": "value2"
      }
    }
  },
  "time_range": {},
  "datasource": "prometheus-1",
  "experiment_types": [
    "container",
    "namespace"
  ]
  "webhooks": {
      "default": "http://URL:PORT/bulkAPIDefaultWebhook",
      "Error": ""http://URL:PORT/bulkAPIErrorWebhook"
  }
}

Also what gets posted on the Webhook is the BulkAPI response as-is.

Implemented

Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Signed-off-by: msvinaykumar <vinakuma@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kruize-local Tag for mentioning all the PR's and issues raised which covers the kruize local monitoring usecase
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

2 participants