opbot

command module
v0.4.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 3 Imported by: 0

README

OpBot

Go Reference Go Report Card

OpBot is a Slack bot written in Go that interacts with the Signoz trace API to provide various functionalities, including searching for transactions based on user-provided tags. This bot is designed to help teams monitor and manage their operations more effectively by integrating with Slack and Signoz.

Features

  • Slack Integration: Interact with the bot directly from Slack.
  • Signoz Integration: Search for transactions and traces using the Signoz API.
  • Configuration Management: Easily manage configuration through YAML files.
  • Metrics Handling: Integrated with metrics handling for better monitoring.

Installation

  1. Clone the repository:

    git clone https://github.com/synapsecns/sanguine.git
    cd sanguine/contrib/opbot
    
  2. Install dependencies: Ensure you have Go installed (version 1.22.4 or later). Then, run:

    go mod tidy
    
  3. Build the bot:

    go build -o opbot main.go
    

Configuration

OpBot uses a YAML configuration file to manage its settings. The configuration file should be named config.yml and placed in the same directory as the executable.

Example config.yml
slack_bot_token: "your-slack-bot-token"
slack_app_token: "your-slack-app-token"
signoz_email: "your-signoz-email"
signoz_password: "your-signoz-password"
signoz_base_url: "https://signoz.example.com"
Configuration Fields
  • slack_bot_token: The token for your Slack bot.
  • slack_app_token: The token for your Slack app.
  • signoz_email: The email address used to log in to Signoz.
  • signoz_password: The password used to log in to Signoz.
  • signoz_base_url: The base URL for the Signoz API.

Usage

  1. Start the bot:

    ./opbot start --config config.yml
    
  2. Interact with the bot in Slack:

  • Use commands to search for transactions in Signoz.
  • Example command: /opbot search --tag key:value

Development

Directory Structure
  • cmd: Contains the command line interface for the bot.
  • config: Provides functionality to read and write configuration files.
  • botmd: Contains the main bot server implementation.
  • metadata: Provides metadata services for the bot.
  • signoz: Contains the Signoz client for interacting with the Signoz API.

Feel free to reach out if you have any questions or need further assistance!

Documentation

Overview

Package main provides the entry point for the opbot.

Directories

Path Synopsis
Package botmd provides the bot server.
Package botmd provides the bot server.
Package cmd provides the command line interface for the opbot.
Package cmd provides the command line interface for the opbot.
Package config provides a simple way to read and write configuration files.
Package config provides a simple way to read and write configuration files.
Package metadata provides a metadata service for opbot.
Package metadata provides a metadata service for opbot.
Package signoz is a api client for signoz, more specifically the trace API https://signoz.io/docs/traces-management/trace-api/overview/ the client is based on resty.
Package signoz is a api client for signoz, more specifically the trace API https://signoz.io/docs/traces-management/trace-api/overview/ the client is based on resty.
example/keychain
Package keychain wraps go-keychain.
Package keychain wraps go-keychain.
generated
Package model contains the data models for the Signoz API.
Package model contains the data models for the Signoz API.
sql
Package sql provides a common interface for starting sql-lite databases
Package sql provides a common interface for starting sql-lite databases
base
Package base contains the base sql implementation
Package base contains the base sql implementation
mysql
Package mysql contains a mysql db
Package mysql contains a mysql db
sqlite
Package sqlite implements the sqlite package
Package sqlite implements the sqlite package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL