Coder Social home page Coder Social logo

kubernetes-chatgpt-bot's People

Contributors

aantn avatar adiseshan avatar arikalon1 avatar avi-robusta avatar pavangudiwada avatar susmita-dey avatar suzdalnitski avatar zenandyainsworth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kubernetes-chatgpt-bot's Issues

panic: Unable to create mmap-ed active query log when creating prometheus-robusta-kube-prometheus-st-prometheus-0 pod

root@nef:~# kubectl logs prometheus-robusta-kube-prometheus-st-prometheus-0
ts=2023-03-24T11:09:16.291Z caller=main.go:556 level=info msg="Starting Prometheus Server" mode=server version="(version=2.40.5, branch=HEAD, revision=44af4716c86138869aa621737139e6dacf0e2550)"
ts=2023-03-24T11:09:16.292Z caller=main.go:561 level=info build_context="(go=go1.19.3, user=root@70f803b28803, date=20221201-12:50:06)"
ts=2023-03-24T11:09:16.292Z caller=main.go:562 level=info host_details="(Linux 5.4.0-144-generic #161-Ubuntu SMP Fri Feb 3 14:49:04 UTC 2023 x86_64 prometheus-robusta-kube-prometheus-st-prometheus-0 (none))"
ts=2023-03-24T11:09:16.292Z caller=main.go:563 level=info fd_limits="(soft=1048576, hard=1048576)"
ts=2023-03-24T11:09:16.292Z caller=main.go:564 level=info vm_limits="(soft=unlimited, hard=unlimited)"
ts=2023-03-24T11:09:16.292Z caller=query_logger.go:91 level=error component=activeQueryTracker msg="Error opening query log file" file=/prometheus/queries.active err="open /prometheus/queries.active: permission denied"
panic: Unable to create mmap-ed active query log

goroutine 1 [running]:
github.com/prometheus/prometheus/promql.NewActiveQueryTracker({0x7fff254b9126, 0xb}, 0x14, {0x3b92be0, 0xc0000988c0})
/app/promql/query_logger.go:121 +0x3cd
main.main()
/app/cmd/prometheus/main.go:618 +0x6973

Built a Website for the bot

Hello, I'm a web developer and I want to built a website for the bot listing out its features and also a playground just like chatgpt so that people can use it seamlessly.

ChatGPT works in one sink and it doesn't work in another

I set up the second Slack channel (pd-alerts), where are sent only alerts from the apps namespace. I receive the alerts from the desired namespace there, but the AskChatGPT button doesn't work (nothing happens). At the same time, in the main sink (the first Slack channel), I can use ChatGPT.
This behavior is strange: ChatGPT works in one sink and it doesn't work in another.

This is my configuration:

sinksConfig:
- slack_sink:
    name: main_slack_sink
    slack_channel: robusta-test
    api_key: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
- slack_sink:
    name: pd_slack_sink
    slack_channel: pd-alerts
    api_key: rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr    
    scope:
      include:
        - namespace: apps

ChatGPT response is not coming to Slack

All of the alerts are coming to slack and Integration also looks good. Ask ChatGPT button is visible in Slack UI
image
But ChatGPT response is not coming.

Cluster is behind the Proxy, it may be reason. Any suggestion or ways to debug?

Prompt engineering

Copying over this idea from the reddit post :)

If anyone is curious, you can change the prompt on line 77 to tweak the answers.

For example, maybe you'll get better answers by including pod logs:

search_term=f"How to solve {alert_name} on Kubernetes when the log is {alert.pod.get_logs()}?"

Or maybe you'd prefer an answer from Captain Jack Sparrow:

search_term=f"Explain like a pirate how to solve {alert_name} on Kubernetes?"

PRs welcome!

Teams integration

Your readme says to open an issue for teams integration. I'd love that!

Chat GPT token exposed

If you open slack in a browser you can easily see chat_gtp_token
token

I think it's safer to remove chat_gpt_token from the Action Params and read the token from an environment variable. Also, the environment variable can be added using the value of the chart runner.additional_env_vars value, example:

runner:
  additional_env_vars:
  - name: OPENAI_API_KEY
    value: 

PODS in pending state as persistent volume is missing

Hi

Below pods are in pending state as PersistentVolumes have not got configured after helm install and helm upgrade of robusta. I have followed the steps mentioned in the readme but this is the state where I have got stuck. Please let me know the workaround.

root@k8sautochatgpt:~# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
default alertmanager-robusta-kube-prometheus-st-alertmanager-0 0/2 Pending 0 22m
default prometheus-robusta-kube-prometheus-st-prometheus-0 0/2 Pending 0 22m
default robusta-forwarder-bb4fdfb88-vwkxs 1/1 Running 0 23m
default robusta-grafana-f6c6b9d4d-4qhxj 3/3 Running 0 23m
default robusta-kube-prometheus-st-operator-56b86ffb9f-24bc7 1/1 Running 0 23m
default robusta-kube-state-metrics-578cc467c5-xdthx 1/1 Running 0 23m
default robusta-prometheus-node-exporter-v4vdt 1/1 Running 0 23m
default robusta-runner-8695c9d6f9-2tgcx 1/1 Running 0 23m
kube-flannel kube-flannel-ds-jmmsz 1/1 Running 0 84m
kube-system coredns-787d4945fb-cth7p 1/1 Running 0 84m
kube-system coredns-787d4945fb-rfz2t 1/1 Running 0 84m
kube-system etcd-k8sautochatgpt 1/1 Running 0 84m
kube-system kube-apiserver-k8sautochatgpt 1/1 Running 0 84m
kube-system kube-controller-manager-k8sautochatgpt 1/1 Running 0 84m
kube-system kube-proxy-gqvh4 1/1 Running 0 84m
kube-system kube-scheduler-k8sautochatgpt 1/1 Running 0 84m

root@k8sautochatgpt:~# kubectl describe pod prometheus-robusta-kube-prometheus-st-prometheus-0
Events:
Type Reason Age From Message


Warning FailedScheduling 2m22s (x5 over 22m) default-scheduler 0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod..

root@k8sautochatgpt:~# kubectl describe pod alertmanager-robusta-kube-prometheus-st-alertmanager-0
Events:
Type Reason Age From Message


Warning FailedScheduling 2m7s (x6 over 23m) default-scheduler 0/1 nodes are available: pod has unbound immediate PersistentVolumeClaims. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod..
root@k8sautochatgpt:# kubectl get pv,pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/alertmanager-robusta-kube-prometheus-st-alertmanager-db-alertmanager-robusta-kube-prometheus-st-alertmanager-0 Pending 23m
persistentvolumeclaim/prometheus-robusta-kube-prometheus-st-prometheus-db-prometheus-robusta-kube-prometheus-st-prometheus-0 Pending 23m
root@k8sautochatgpt:
#

Not ChatGPT

Correct me if I'm wrong, but this tool is using GPT-3 via the OpenAI API, not the specifically dialog fine tuned, GPT3.5 model based ChatGPT. There is no API into ChatGPT yet and until there is and it's switched over, you might want to adjust the wording in the README and code to avoid confusion.

"Ask Chat GPT" Button doesn't appear

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 ?

New Relic Integration

Would like to see this integrated with New Relic either through a Nerd Pack or a different mechanism. Currently New Relic alerts will give you a graph image in their alerts but they don't add much context around their alert nor does their AI give much clarity half the time.

After installation, the ack button is not seen

error logs:

kubectl logs robusta-runner-6fc46d9464-w92pg -n robusta

2023-04-03 09:16:08.043 INFO Importing actions package chatgpt_robusta_actions
2023-04-03 09:16:08.044 INFO importing actions from chatgpt_robusta_actions.chat_gpt
2023-04-03 09:16:08.048 WARNING Docstring contains description of token which is not a field on the model
2023-04-03 09:16:08.054 WARNING Docstring contains description of token which is not a field on the model
2023-04-03 09:16:08.055 INFO Adding <class 'robusta.core.sinks.robusta.robusta_sink_params.RobustaSinkConfigWrapper'> sink named robusta_ui_sink
2023-04-03 09:16:08.055 ERROR Error configuring sink robusta_ui_sink of type <class 'robusta.core.sinks.robusta.robusta_sink_params.RobustaSinkConfigWrapper'>: 'utf-8' codec can't decode bytes in position 0-1: invalid continuation byte

Could you please advise me how to troubleshoot the problem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.