oteldisgo

package module
v0.0.0-...-b5ef66d Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Go Reference Go Report Go Version License Otel DisGo Version DisGo Discord

OtelDisGo

OtelDisGo is a DisGo handler middleware for OpenTelemetry. It provides a simple way to trace your DisGo commands.

Summary

  1. Getting Started
  2. Documentation
  3. Troubleshooting
  4. Contributing
  5. License

Getting Started

Installing
$ go get github.com/disgoorg/oteldisgo
Usage

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
}

OTEL Tracing

OtelDisGo provides the following spans attributes:

  1. For All:
    • interaction.tye - The type of the interaction
    • interaction.id - The id of the interaction
    • interaction.application.id - The id of the application
    • interaction.user.id - The id of the user
    • interaction.channel.id - The id of the channel
    • interaction.guild.id - The id of the guild (if applicable)
    • interaction.createdat - The time the interaction was created
  2. Application Command Interaction
    • interaction.command.id - The id of the command
    • interaction.command.name - The name of the command
    • interaction.command.guild.id - The guild id of the command (if applicable)
    1. Slash Command Interaction
      • interaction.command.subcommand - The subcommand of the command
      • interaction.command.subcommandgroup - The subcommand group of the command
      • interaction.command.path - The full path of the command
    2. User Command Interaction
      • interaction.command.user.id - The id of the user who the command was used on
    3. Message Command Interaction
      • interaction.command.message.id - The id of the message the command was used on
  3. AutoComplete Interaction
    • interaction.command.id - The id of the command
    • interaction.command.name - The name of the command
    • interaction.command.subcommand - The subcommand of the command
    • interaction.command.subcommandgroup - The subcommand group of the command
    • interaction.command.path - The full path of the command
    • interaction.command.guild.id - The guild id of the command (if applicable)
  4. Component Interaction
    • interaction.component.type - The type of the component
    • interaction.component.customid - The custom id of the component
  5. Modal Interaction
    • interaction.component.customid - The custom id of the modal

Documentation

Documentation can be found under

  • Go Reference
  • OpenTelemetry Documentation

Troubleshooting

For help feel free to open an issue or reach out on Discord

Contributing

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.

License

Distributed under the License. See LICENSE for more information.

Supported by Jetbrains

Jetbrain Open Source Community Support

Jump to

Keyboard shortcuts

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