OtelDisGo is a DisGo handler middleware for OpenTelemetry. It provides a simple way to trace your DisGo commands.
$ go get github.com/disgoorg/oteldisgo
Check https://opentelemetry.io/docs/languages/go/getting-started/ for more information on how to set up OpenTelemetry.
package main
import (
"github.com/disgoorg/disgo/handler"
"github.com/disgoorg/oteldisgo"
)
func main() {
r := handler.New()
r.Use(oteldisgo.Middleware("example"))
// handle commands as usual here
}
OtelDisGo provides the following spans attributes:
- For All:
interaction.tye
- The type of the interactioninteraction.id
- The id of the interactioninteraction.application.id
- The id of the applicationinteraction.user.id
- The id of the userinteraction.channel.id
- The id of the channelinteraction.guild.id
- The id of the guild (if applicable)interaction.createdat
- The time the interaction was created
- Application Command Interaction
interaction.command.id
- The id of the commandinteraction.command.name
- The name of the commandinteraction.command.guild.id
- The guild id of the command (if applicable)
- Slash Command Interaction
interaction.command.subcommand
- The subcommand of the commandinteraction.command.subcommandgroup
- The subcommand group of the commandinteraction.command.path
- The full path of the command
- User Command Interaction
interaction.command.user.id
- The id of the user who the command was used on
- Message Command Interaction
interaction.command.message.id
- The id of the message the command was used on
- AutoComplete Interaction
interaction.command.id
- The id of the commandinteraction.command.name
- The name of the commandinteraction.command.subcommand
- The subcommand of the commandinteraction.command.subcommandgroup
- The subcommand group of the commandinteraction.command.path
- The full path of the commandinteraction.command.guild.id
- The guild id of the command (if applicable)
- Component Interaction
interaction.component.type
- The type of the componentinteraction.component.customid
- The custom id of the component
- Modal Interaction
interaction.component.customid
- The custom id of the modal
Documentation can be found under
For help feel free to open an issue or reach out on Discord
Contributions are welcomed but for bigger changes we recommend first reaching out via Discord or create an issue to discuss your problems, intentions and ideas.