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

Collect metrics in EPP for unsuccessful deliveries with active Jetstream backend #17547

Closed
Tracked by #18
k15r opened this issue May 22, 2023 · 0 comments · Fixed by #17802 or #17822
Closed
Tracked by #18

Collect metrics in EPP for unsuccessful deliveries with active Jetstream backend #17547

k15r opened this issue May 22, 2023 · 0 comments · Fixed by #17802 or #17822
Labels
area/eventing Issues or PRs related to eventing

Comments

@k15r
Copy link
Contributor

k15r commented May 22, 2023

Motivation

In our event publisher proxy we only return HTTP 204 for successful deliveries with the jetstream backend and HTTP 503 for every error case. Metrics only get recorded for successful deliveries (204). In order to implement proper SLA tracking we need to record metrics also for unsuccessful deliveries.

Description

  • return more specific HTTP codes based on the errors returned from Jetstream (see: https://github.com/nats-io/nats.go/blob/main/jserrors.go)
  • record metrics for every request to the event publisher proxy with the backend set to jetstream.
    eventing_epp_messaging_server_latency_duration_milliseconds
    epp_event_type_published_total
    eventing_epp_requests_total
    

Hints

func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2event.Event, host string, header http.Header) (sender.PublishResult, error) {
exits early if a publishing requests fails on Jetstream. In order to implement the requested change we need to record the metric also in case of an error.

Attachments
Original Issue: #15936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/eventing Issues or PRs related to eventing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant