slack chatbot
/k-bot pods/k-bot logs [service] [tail]k-bot exports metrics on the same port as the app (defaults to 1012) on /metrics route
In addition to usage metrics, a custom metric is also exported:
- Type: Counter
- Labels: command, userID
- create the signing secret (from slack)
~ $ k create secret generic k-bot-slack-secret --from-literal secret=xxxxxx - Install the helm3 chart. In
values.yaml, you will have to provide the ingress host name, slack signing secret details, and enable rbac if your cluster needs it.
~ $ helm3 install chart/k-bot --generate-name --namespace default
NAME: k-bot-1597572730
LAST DEPLOYED: Sun Aug 16 13:12:13 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
http://k-bot.yourdomain.io/
~ $ cd src
~ $ go test
Registering counter vector
PASS
ok github.com/Efrat19/devops-task/src 0.683s1.Production-readiness: code should be reliable, tested and clean.
- Small reusable functions
- The code follows clean code principles
- The code follows Go error handling best practices
2.Developer Experience (DX): deliver easy-to-use, self-service experience.
- Command Help Text
- Markdown Formatting
3.Security.
The code uses slack built-in token-based authentication to secure the communication using a signing secret
4.Observability: easily investigate and learn how the bot is being used.
- Various log levels (
debug,info,warnanderror) - Clear error messages
- usage metrics exported in prometheus-readable format
- k8s client:
- get name, age, and /version of each running pod
- get x log lines
- slack server
- accept slash command
- expose metrics
- requests counter
- tests
- errors handling
- logs



