sentry

package module
v0.0.0-...-7c33c91 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2019 License: MIT Imports: 9 Imported by: 0

README

RoadRunner Sentry integration

Sentry events handler for RoadRunner.

Installation

QuickBuild

Add to .build.json package github.com/UPDG/roadrunner-sentry and register it as rr.Container.Register(sentry.ID, &sentry.Service{})

After it build RR using QuickBuild.

Example of final file:

{
  "packages": [
    "github.com/spiral/roadrunner/service/env",
    "github.com/spiral/roadrunner/service/http",
    "github.com/spiral/roadrunner/service/rpc",
    "github.com/spiral/roadrunner/service/static",
    "github.com/UPDG/roadrunner-sentry"
  ],
  "commands": [
    "github.com/spiral/roadrunner/cmd/rr/http"
  ],
  "register": [
    "rr.Container.Register(env.ID, &env.Service{})",
    "rr.Container.Register(rpc.ID, &rpc.Service{})",
    "rr.Container.Register(http.ID, &http.Service{})",
    "rr.Container.Register(static.ID, &static.Service{})",
    "rr.Container.Register(sentry.ID, &sentry.Service{})"
  ]
}
Manual
  1. Add dependency by running go get github.com/UPDG/roadrunner-sentry

  2. Add to cms/rr/main.go import github.com/UPDG/roadrunner-sentry

  3. Add to cms/rr/main.go line rr.Container.Register(sentry.ID, &sentry.Service{}) after rr.Container.Register(http.ID, &http.Service{})

Final file should look like this:

package main

import (
	"github.com/sirupsen/logrus"
	rr "github.com/spiral/roadrunner/cmd/rr/cmd"

	// services (plugins)
	"github.com/spiral/roadrunner/service/env"
	"github.com/spiral/roadrunner/service/http"
	"github.com/spiral/roadrunner/service/rpc"
	"github.com/spiral/roadrunner/service/static"
	"github.com/UPDG/roadrunner-sentry"

	// additional commands and debug handlers
	_ "github.com/spiral/roadrunner/cmd/rr/http"
)

func main() {
	rr.Container.Register(env.ID, &env.Service{})
	rr.Container.Register(rpc.ID, &rpc.Service{})
	rr.Container.Register(http.ID, &http.Service{})
	rr.Container.Register(static.ID, &static.Service{})
	rr.Container.Register(sentry.ID, &sentry.Service{})

	rr.Logger.Formatter = &logrus.TextFormatter{ForceColors: true}

	// you can register additional commands using cmd.CLI
	rr.Execute()
}

Configuration

Add your RoadRunner config (.rr.yaml by default) this lines:

sentry:
  DSN: <your senry DSN>

Documentation

Index

Constants

View Source
const ID = "sentry"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Contains Sentry DSN.
	DSN string
}

func (*Config) Hydrate

func (c *Config) Hydrate(cfg service.Config) error

Hydrate must populate Config values using given Config source. Must return error if Config is not valid.

func (*Config) Valid

func (c *Config) Valid() error

type Service

type Service struct {
}

func (*Service) Init

func (s *Service) Init(cfg *Config) (bool, error)

Jump to

Keyboard shortcuts

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