Documentation ¶
Index ¶
- Variables
- type Correlation
- type CorrelationConfig
- type CorrelationConfigType
- type CorrelationsService
- func (s CorrelationsService) CreateCorrelation(ctx context.Context, cmd CreateCorrelationCommand) (Correlation, error)
- func (s CorrelationsService) DeleteCorrelation(ctx context.Context, cmd DeleteCorrelationCommand) error
- func (s CorrelationsService) DeleteCorrelationsBySourceUID(ctx context.Context, cmd DeleteCorrelationsBySourceUIDCommand) error
- func (s CorrelationsService) DeleteCorrelationsByTargetUID(ctx context.Context, cmd DeleteCorrelationsByTargetUIDCommand) error
- func (s CorrelationsService) GetCorrelation(ctx context.Context, cmd GetCorrelationQuery) (Correlation, error)
- func (s CorrelationsService) GetCorrelations(ctx context.Context, cmd GetCorrelationsQuery) ([]Correlation, error)
- func (s CorrelationsService) GetCorrelationsBySourceUID(ctx context.Context, cmd GetCorrelationsBySourceUIDQuery) ([]Correlation, error)
- func (s CorrelationsService) UpdateCorrelation(ctx context.Context, cmd UpdateCorrelationCommand) (Correlation, error)
- type CreateCorrelationCommand
- type CreateCorrelationParams
- type CreateCorrelationResponse
- type CreateCorrelationResponseBody
- type DeleteCorrelationCommand
- type DeleteCorrelationParams
- type DeleteCorrelationResponse
- type DeleteCorrelationResponseBody
- type DeleteCorrelationsBySourceUIDCommand
- type DeleteCorrelationsByTargetUIDCommand
- type GetCorrelationParams
- type GetCorrelationQuery
- type GetCorrelationResponse
- type GetCorrelationsBySourceUIDParams
- type GetCorrelationsBySourceUIDQuery
- type GetCorrelationsBySourceUIDResponse
- type GetCorrelationsQuery
- type GetCorrelationsResponse
- type Service
- type UpdateCorrelationCommand
- type UpdateCorrelationParams
- type UpdateCorrelationResponse
- type UpdateCorrelationResponseBody
Constants ¶
This section is empty.
Variables ¶
var ( ErrSourceDataSourceReadOnly = errors.New("source data source is read only") ErrSourceDataSourceDoesNotExists = errors.New("source data source does not exist") ErrTargetDataSourceDoesNotExists = errors.New("target data source does not exist") ErrCorrelationFailedGenerateUniqueUid = errors.New("failed to generate unique correlation UID") ErrCorrelationNotFound = errors.New("correlation not found") ErrUpdateCorrelationEmptyParams = errors.New("not enough parameters to edit correlation") ErrInvalidConfigType = errors.New("invalid correlation config type") )
var ( // ConfigurationPageAccess is used to protect the "Configure > correlations" tab access ConfigurationPageAccess = accesscontrol.EvalPermission(datasources.ActionRead) )
Functions ¶
This section is empty.
Types ¶
type Correlation ¶
type Correlation struct { // Unique identifier of the correlation // example: 50xhMlg9k UID string `json:"uid" xorm:"pk 'uid'"` // UID of the data source the correlation originates from // example:d0oxYRg4z SourceUID string `json:"sourceUID" xorm:"pk 'source_uid'"` // UID of the data source the correlation points to // example:PE1C5CBDA0504A6A3 TargetUID *string `json:"targetUID" xorm:"target_uid"` // Label identifying the correlation // example: My Label Label string `json:"label" xorm:"label"` // Description of the correlation // example: Logs to Traces Description string `json:"description" xorm:"description"` // Correlation Configuration // example: { field: "job", target: { query: "job=app" } } Config CorrelationConfig `json:"config" xorm:"jsonb config"` }
Correlation is the model for correlations definitions swagger:model
type CorrelationConfig ¶
type CorrelationConfig struct { // Field used to attach the correlation link // required:true Field string `json:"field" binding:"Required"` // Target type // required:true Type CorrelationConfigType `json:"type" binding:"Required"` // Target data query // required:true Target map[string]interface{} `json:"target" binding:"Required"` }
swagger:model
func (CorrelationConfig) MarshalJSON ¶
func (c CorrelationConfig) MarshalJSON() ([]byte, error)
type CorrelationConfigType ¶
type CorrelationConfigType string
const (
ConfigTypeQuery CorrelationConfigType = "query"
)
func (CorrelationConfigType) Validate ¶
func (t CorrelationConfigType) Validate() error
type CorrelationsService ¶
type CorrelationsService struct { SQLStore *sqlstore.SQLStore RouteRegister routing.RouteRegister DataSourceService datasources.DataSourceService AccessControl accesscontrol.AccessControl // contains filtered or unexported fields }
func ProvideService ¶
func ProvideService(sqlStore *sqlstore.SQLStore, routeRegister routing.RouteRegister, ds datasources.DataSourceService, ac accesscontrol.AccessControl, bus bus.Bus) *CorrelationsService
func (CorrelationsService) CreateCorrelation ¶
func (s CorrelationsService) CreateCorrelation(ctx context.Context, cmd CreateCorrelationCommand) (Correlation, error)
func (CorrelationsService) DeleteCorrelation ¶
func (s CorrelationsService) DeleteCorrelation(ctx context.Context, cmd DeleteCorrelationCommand) error
func (CorrelationsService) DeleteCorrelationsBySourceUID ¶
func (s CorrelationsService) DeleteCorrelationsBySourceUID(ctx context.Context, cmd DeleteCorrelationsBySourceUIDCommand) error
func (CorrelationsService) DeleteCorrelationsByTargetUID ¶
func (s CorrelationsService) DeleteCorrelationsByTargetUID(ctx context.Context, cmd DeleteCorrelationsByTargetUIDCommand) error
func (CorrelationsService) GetCorrelation ¶
func (s CorrelationsService) GetCorrelation(ctx context.Context, cmd GetCorrelationQuery) (Correlation, error)
func (CorrelationsService) GetCorrelations ¶
func (s CorrelationsService) GetCorrelations(ctx context.Context, cmd GetCorrelationsQuery) ([]Correlation, error)
func (CorrelationsService) GetCorrelationsBySourceUID ¶
func (s CorrelationsService) GetCorrelationsBySourceUID(ctx context.Context, cmd GetCorrelationsBySourceUIDQuery) ([]Correlation, error)
func (CorrelationsService) UpdateCorrelation ¶
func (s CorrelationsService) UpdateCorrelation(ctx context.Context, cmd UpdateCorrelationCommand) (Correlation, error)
type CreateCorrelationCommand ¶
type CreateCorrelationCommand struct { // UID of the data source for which correlation is created. SourceUID string `json:"-"` OrgId int64 `json:"-"` SkipReadOnlyCheck bool `json:"-"` // Target data source UID to which the correlation is created // example:PE1C5CBDA0504A6A3 TargetUID *string `json:"targetUID"` // Optional label identifying the correlation // example: My label Label string `json:"label"` // Optional description of the correlation // example: Logs to Traces Description string `json:"description"` // Arbitrary configuration object handled in frontend // example: { field: "job", target: { query: "job=app" } } Config CorrelationConfig `json:"config" binding:"Required"` }
CreateCorrelationCommand is the command for creating a correlation swagger:model
func (CreateCorrelationCommand) Validate ¶
func (c CreateCorrelationCommand) Validate() error
type CreateCorrelationParams ¶
type CreateCorrelationParams struct { // in:body // required:true Body CreateCorrelationCommand `json:"body"` // in:path // required:true SourceUID string `json:"sourceUID"` }
swagger:parameters createCorrelation
type CreateCorrelationResponse ¶
type CreateCorrelationResponse struct { // in: body Body CreateCorrelationResponseBody `json:"body"` }
type CreateCorrelationResponseBody ¶
type CreateCorrelationResponseBody struct { Result Correlation `json:"result"` // example: Correlation created Message string `json:"message"` }
CreateCorrelationResponse is the response struct for CreateCorrelationCommand swagger:model
type DeleteCorrelationCommand ¶
type DeleteCorrelationCommand struct { // UID of the correlation to be deleted. UID string SourceUID string OrgId int64 }
DeleteCorrelationCommand is the command for deleting a correlation
type DeleteCorrelationParams ¶
type DeleteCorrelationParams struct { // in:path // required:true DatasourceUID string `json:"uid"` // in:path // required:true CorrelationUID string `json:"correlationUID"` }
swagger:parameters deleteCorrelation
type DeleteCorrelationResponse ¶
type DeleteCorrelationResponse struct { // in: body Body DeleteCorrelationResponseBody `json:"body"` }
type DeleteCorrelationResponseBody ¶
type DeleteCorrelationResponseBody struct { // example: Correlation deleted Message string `json:"message"` }
swagger:model
type DeleteCorrelationsBySourceUIDCommand ¶
type DeleteCorrelationsBySourceUIDCommand struct {
SourceUID string
}
type DeleteCorrelationsByTargetUIDCommand ¶
type DeleteCorrelationsByTargetUIDCommand struct {
TargetUID string
}
type GetCorrelationParams ¶
type GetCorrelationParams struct { // in:path // required:true DatasourceUID string `json:"sourceUID"` // in:path // required:true CorrelationUID string `json:"correlationUID"` }
swagger:parameters getCorrelation
type GetCorrelationQuery ¶
type GetCorrelationQuery struct { // UID of the correlation UID string `json:"-"` // UID of the source data source SourceUID string `json:"-"` OrgId int64 `json:"-"` }
GetCorrelationQuery is the query to retrieve a single correlation
type GetCorrelationResponse ¶
type GetCorrelationResponse struct { // in: body Body Correlation `json:"body"` }
type GetCorrelationsBySourceUIDParams ¶
type GetCorrelationsBySourceUIDParams struct { // in:path // required:true DatasourceUID string `json:"sourceUID"` }
swagger:parameters getCorrelationsBySourceUID
type GetCorrelationsBySourceUIDQuery ¶
GetCorrelationsBySourceUIDQuery is the query to retrieve all correlations originating by the given Data Source
type GetCorrelationsBySourceUIDResponse ¶
type GetCorrelationsBySourceUIDResponse struct { // in: body Body []Correlation `json:"body"` }
type GetCorrelationsQuery ¶
type GetCorrelationsQuery struct {
OrgId int64 `json:"-"`
}
GetCorrelationsQuery is the query to retrieve all correlations
type GetCorrelationsResponse ¶
type GetCorrelationsResponse struct { // in: body Body []Correlation `json:"body"` }
type Service ¶
type Service interface { CreateCorrelation(ctx context.Context, cmd CreateCorrelationCommand) (Correlation, error) DeleteCorrelation(ctx context.Context, cmd DeleteCorrelationCommand) error DeleteCorrelationsBySourceUID(ctx context.Context, cmd DeleteCorrelationsBySourceUIDCommand) error DeleteCorrelationsByTargetUID(ctx context.Context, cmd DeleteCorrelationsByTargetUIDCommand) error }
type UpdateCorrelationCommand ¶
type UpdateCorrelationCommand struct { // UID of the correlation to be deleted. UID string `json:"-"` SourceUID string `json:"-"` OrgId int64 `json:"-"` // Optional label identifying the correlation // example: My label Label *string `json:"label"` // Optional description of the correlation // example: Logs to Traces Description *string `json:"description"` }
UpdateCorrelationCommand is the command for updating a correlation
type UpdateCorrelationParams ¶
type UpdateCorrelationParams struct { // in:path // required:true DatasourceUID string `json:"sourceUID"` // in:path // required:true CorrelationUID string `json:"correlationUID"` // in: body Body UpdateCorrelationCommand `json:"body"` }
swagger:parameters updateCorrelation
type UpdateCorrelationResponse ¶
type UpdateCorrelationResponse struct { // in: body Body UpdateCorrelationResponseBody `json:"body"` }
type UpdateCorrelationResponseBody ¶
type UpdateCorrelationResponseBody struct { Result Correlation `json:"result"` // example: Correlation updated Message string `json:"message"` }
swagger:model