robusta-dev / kubernetes-chatgpt-bot

A ChatGPT bot for Kubernetes issues.
923 stars 103 forks source link

"Ask Chat GPT" Button doesn't appear #14

Closed gugdewescale closed 1 year ago

gugdewescale commented 1 year ago

Hello!

I find the project interesting, but despite setting things up as said in the documentation, the ask_chat_gpt enrichment does not add anything...

There is no hint in the logs (DEBUG mode):

2023-04-03 18:45:04.501 INFO     Importing actions package chatgpt_robusta_actions
2023-04-03 18:45:04.503 INFO     importing actions from chatgpt_robusta_actions.chat_gpt
2023-04-03 18:45:04.778 WARNING  Docstring contains description of token which is not a field on the model
2023-04-03 18:45:04.795 WARNING  Docstring contains description of token which is not a field on the model
2023-04-03 18:45:04.805 WARNING  Docstring contains description of token which is not a field on the model
2023-04-03 18:45:04.819 WARNING  Docstring contains description of token which is not a field on the model

I use the following configuration:

    clusterName: [...]
    globalConfig:
      chat_gpt_token: [...]
      signing_key: [...]
      account_id: [...]
    sinksConfig:
    - slack_sink:
        name: main_slack_sink
        slack_channel: [...]
        api_key: [...]
    - robusta_sink:
        name: robusta_ui_sink
        token: [...]
    enablePrometheusStack: true
    enablePlatformPlaybooks: true
    runner:
      sendAdditionalTelemetry: false
      log_level: DEBUG
    rsa:
      private: [...]
      public: [...]
    # This part is added to the default generated_values.yaml
    playbookRepos:
      chatgpt_robusta_actions:
        url: "https://github.com/robusta-dev/kubernetes-chatgpt-bot.git"

    # This part is added to the default generated_values.yaml
    customPlaybooks:
    # Add the 'Ask ChatGPT' button to all Prometheus alerts
    - triggers:
      - on_prometheus_alert: {}
      actions:
      - chat_gpt_enricher: {}

I do get notifications in my Slack channel, but only the "investigate" button appears.

image

Do you have any idea what could have gone wrong ?

damienvergnaud commented 1 year ago

Really interested by a response on this 🤔

arikalon1 commented 1 year ago

Thanks for reporting it @gugdewescale

The configuration looks good to me Robusta has 2 types of notifications:

The configuration above adds the Chat GPT button to Prometheus alerts. Did you have Prometheus alerts on the Slack channel?

You can simulate a Prometheus alerts with the Robusta CLI:

robusta playbooks trigger prometheus_alert pod_name=prometheus-robusta-kube-prometheus-st-prometheus-0 pod_namespace=robusta alert_name=KubeContainerWaiting

Can you try running that? Do you have a notification for the KubeContainerWaiting alert in Slack? Does it have the ChatGPT button?

arikalon1 commented 1 year ago

@damienvergnaud do you have a similar issue?

damienvergnaud commented 1 year ago

@damienvergnaud do you have a similar issue? I made the same mistake "assuming" a kubernetes error would have been logged and processed by chatgpt-bot, thank you for pointing out :)

gugdewescale commented 1 year ago

@arikalon1 Yes that was it, thanks for your quick answer (and sorry my late one)