export

package module
v0.0.0-...-3fd3e6a Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sentry-event-exporter

This is a tiny utility written in Go that retrieves submitted events from Sentry and exports as CSV.

Building

$ go get github.com/opencollector/sentry-event-exporter/cmd/sentry-event-exporter

Synopsis

$ sentry-event-exporter -help
Usage of sentry-event-exporter:
  -authtoken string
        Sentry authentication token (get it at https://sentry.io/settings/account/api/auth-tokens/ )
  -endpoint string
        Sentry endpoint
  -events
        include events in the result
  -organization string
        organization
  -project string
        project
  • -authtoken (defaults to the value of SENTRY_AUTHTOKEN environment variable)

    Specifies the authentication token that can be created and retrieved at https://sentry.io/settings/account/api/auth-tokens/ .

  • -endpoint (defaults to the endpoint managed by sentry.io)

    Specifies the alternate endpoint URL. (Supply it if you want to use your own Sentry instance)

  • -events

    When unspecified, only issues are dumped. Give this option if you want to get the events for those too.

  • -organization (mandatory)

    Specifies the organization.

  • -project (mandatory)

    Specifies the project.

The rest of the arguments are the query. Refer to the Search section of the document for details.

sentry-event-exporter -authtoken xxx -organization yyy -project zzz is:unresolved 'browser:IE 11.0'

License

Copyright (c) 2019 Open Collector, Inc.
                   Moriyoshi Koizumi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVRenderer

type CSVRenderer struct {
	Out                 io.Writer
	FieldSeparator      []byte
	RecordSeparator     []byte
	QuoteCharacter      []byte
	QuoteCharacterStr   string
	CharsNeedToBeQuoted string
}

func NewCSVRenderer

func NewCSVRenderer(out io.Writer, fieldSeparator, recordSeparator, quoteCharacter string) *CSVRenderer

func NewExcelCSVRenderer

func NewExcelCSVRenderer(out io.Writer) *CSVRenderer

func (*CSVRenderer) Fini

func (r *CSVRenderer) Fini()

func (*CSVRenderer) Quote

func (r *CSVRenderer) Quote(v string) []byte

func (*CSVRenderer) RenderFooter

func (r *CSVRenderer) RenderFooter() error

func (*CSVRenderer) RenderHeader

func (r *CSVRenderer) RenderHeader() error

func (*CSVRenderer) RenderOne

func (r *CSVRenderer) RenderOne(result *ExporterResult) error

func (*CSVRenderer) RenderPartialResults

func (r *CSVRenderer) RenderPartialResults(results []ExporterResult) error

func (*CSVRenderer) RenderValue

func (r *CSVRenderer) RenderValue(v reflect.Value) string

type Exporter

type Exporter struct {
	ExporterConfig
	Renderer ExporterResultRenderer
	Client   *sentry.Client
}

func NewExporter

func NewExporter(config ExporterConfig, renderer ExporterResultRenderer) (*Exporter, error)

func (*Exporter) Export

func (exp *Exporter) Export() error

func (*Exporter) RenderIssues

func (exp *Exporter) RenderIssues(issues []sentry.Issue) error

type ExporterConfig

type ExporterConfig struct {
	AuthToken     string
	Endpoint      *string
	Organization  string
	Project       string
	StatsPeriod   *string
	Query         *string
	IncludeEvents bool
}

func (*ExporterConfig) BuildExporterResultsForSingleIssue

func (config *ExporterConfig) BuildExporterResultsForSingleIssue(issue sentry.Issue, events []sentry.Event) []ExporterResult

func (*ExporterConfig) PopulateWithEvent

func (config *ExporterConfig) PopulateWithEvent(r *ExporterResult, event sentry.Event)

func (*ExporterConfig) StringizeInternalUser

func (*ExporterConfig) StringizeInternalUser(u *sentry.InternalUser) string

func (*ExporterConfig) StringizeProject

func (*ExporterConfig) StringizeProject(p *sentry.Project) string

func (*ExporterConfig) StringizeRelease

func (*ExporterConfig) StringizeRelease(r *sentry.Release) string

func (*ExporterConfig) StringizeStatus

func (*ExporterConfig) StringizeStatus(s *sentry.Status) string

func (*ExporterConfig) StringizeTime

func (*ExporterConfig) StringizeTime(t time.Time) string

type ExporterResult

type ExporterResult struct {
	IssueID         string
	AssignedTo      string
	Count           string
	Culprit         string
	FirstSeen       time.Time
	LastSeen        time.Time
	Level           string
	Logger          string
	Permalink       string
	Project         string
	ShareID         string
	ShortID         string
	Status          string
	Title           string
	IssueType       string
	UserCount       int
	UserReportCount int
	EventID         string
	EventType       string
	Release         string
	Message         string
	EventCreated    time.Time
	EventReceived   time.Time
	Platform        string
	GroupID         string
}

type ExporterResultRenderer

type ExporterResultRenderer interface {
	RenderHeader() error
	RenderPartialResults([]ExporterResult) error
	RenderFooter() error
	Fini()
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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