Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breadcrumbs API #6

Open
joshuap opened this issue Mar 31, 2021 · 2 comments
Open

Breadcrumbs API #6

joshuap opened this issue Mar 31, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@joshuap
Copy link
Member

joshuap commented Mar 31, 2021

The client should have a public add_breadcrumb() method that stores an array of breadcrumbs. There should also be a public clear() method (see also: #4) to reset the breadcrumbs to the default ([]).

Supported config options:

  • breadcrumbs_enabled
    • optional
    • default: true
  • max_breadcrumbs
    • optional
    • default: 40

Example:

# Supported configuration options w/ defaults:
Honeybadger.configure({
  # optional
  breadcrumbs_enabled: true,

  # optional
  # The max number of breadcrumbs to store at one time.
  # The oldest breadcrumbs should be dropped as newer breadcrumbs are added.
	max_breadcrumbs: 40
})

# Adding a breadcrumb:
Honeybadger.add_breadcrumb(
	"Email Sent",
	metadata: {
		user: user.id,
		message: message
	}
)

# Clearing context and breadcrumbs:
Honeybadger.clear()

Resources

@joshuap joshuap added enhancement New feature or request help wanted Extra attention is needed labels Mar 31, 2021
@jgaskins
Copy link
Contributor

jgaskins commented Jul 2, 2024

With what I'm doing with events in #37, I was thinking I might also take a swing at this one since events and breadcrumbs seem pretty similar. Is the client library spec link still accurate? If so, it appears not to be public.

@subzero10
Copy link
Member

I was thinking I might also take a swing at this one since events and breadcrumbs seem pretty similar.

Indeed, they are similar in the way that they are queued locally and sent to the API in batches.
However, there are a couple of things to clarify here (probably you are already aware, but I guess there's no harm repeating just in case 😄):

  1. Breadcrumbs are sent along with an error/notice. Events will have to be sent either when a threshold in terms of size or time has passed (as you are already doing in Add support for events for Insights #37).
  2. There's a max number of breadcrumbs stored in the local queue. If the number is exceeded, the older breadcrumbs are dropped. This is not the case for the Events API.

Is the client library spec link still accurate? If so, it appears not to be public.

Hey @jgaskins, the client library spec link should be OK now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants