logfire

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	StatusCode int
	Body       string
}

func (*APIError) Error

func (e *APIError) Error() string

type Alert

type Alert struct {
	ID   string
	Name string
}

type AlertChannel

type AlertChannel struct {
	ID     string `json:"id"`
	Label  string `json:"label"`
	Config *struct {
		URL string `json:"url"`
	} `json:"config,omitempty"`
}

type AlertMetadata

type AlertMetadata struct {
	ID   string `json:"id" mapstructure:"id"`
	Name string `json:"name" mapstructure:"name"`
}

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	APIBaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpCtx core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) DeleteAlertChannel

func (c *Client) DeleteAlertChannel(channelID, channelsPath string) error

func (*Client) DeleteReadToken

func (c *Client) DeleteReadToken(projectID, readTokenID string) error

func (*Client) EnsureAlertHasChannelID

func (c *Client) EnsureAlertHasChannelID(projectID, alertID, channelID string) error

func (*Client) ExecuteQueryWithToken

func (c *Client) ExecuteQueryWithToken(readToken string, request QueryRequest) (*QueryResponse, error)

func (*Client) FindAssignedAlertChannelID

func (c *Client) FindAssignedAlertChannelID(projectID, alertID, preferredLabel, webhookURL string) (string, bool, error)

func (*Client) GetAlertChannelIDs

func (c *Client) GetAlertChannelIDs(projectID, alertID string) ([]string, error)

func (*Client) ListAlerts

func (c *Client) ListAlerts(projectID string) ([]Alert, error)

func (*Client) ListProjects

func (c *Client) ListProjects() ([]Project, error)

func (*Client) ProvisionReadToken

func (c *Client) ProvisionReadToken(projectID string) (string, error)

ProvisionReadToken creates a read token for the given project and validates it. If validation fails, the created token is cleaned up.

func (*Client) UpsertAlertChannel

func (c *Client) UpsertAlertChannel(label, webhookURL, _ string) (*AlertChannel, string, error)

type Configuration

type Configuration struct {
	APIKey  string `json:"apiKey"`
	BaseURL string `json:"baseURL"`
}

type Logfire

type Logfire struct{}

func (*Logfire) Actions

func (l *Logfire) Actions() []core.Action

func (*Logfire) Cleanup

func (l *Logfire) Cleanup(ctx core.IntegrationCleanupContext) error

func (*Logfire) Components

func (l *Logfire) Components() []core.Component

func (*Logfire) Configuration

func (l *Logfire) Configuration() []configuration.Field

func (*Logfire) Description

func (l *Logfire) Description() string

func (*Logfire) HandleAction

func (l *Logfire) HandleAction(ctx core.IntegrationActionContext) error

func (*Logfire) HandleRequest

func (l *Logfire) HandleRequest(ctx core.HTTPRequestContext)

func (*Logfire) Icon

func (l *Logfire) Icon() string

func (*Logfire) Instructions

func (l *Logfire) Instructions() string

func (*Logfire) Label

func (l *Logfire) Label() string

func (*Logfire) ListResources

func (l *Logfire) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Logfire) Name

func (l *Logfire) Name() string

func (*Logfire) Sync

func (l *Logfire) Sync(ctx core.SyncContext) error

func (*Logfire) Triggers

func (l *Logfire) Triggers() []core.Trigger

type LogfireWebhookHandler

type LogfireWebhookHandler struct{}

func (*LogfireWebhookHandler) Cleanup

func (*LogfireWebhookHandler) CompareConfig

func (h *LogfireWebhookHandler) CompareConfig(a, b any) (bool, error)

func (*LogfireWebhookHandler) Merge

func (h *LogfireWebhookHandler) Merge(current, requested any) (any, bool, error)

func (*LogfireWebhookHandler) Setup

type LogfireWebhookMetadata

type LogfireWebhookMetadata struct {
	ManagedChannel       bool   `json:"managedChannel"`
	SupportsWebhookSetup bool   `json:"supportsWebhookSetup"`
	ChannelID            string `json:"channelId,omitempty"`
	ChannelName          string `json:"channelName,omitempty"`
	ChannelsPath         string `json:"channelsPath,omitempty"`
}

type Metadata

type Metadata struct {
	ExternalOrganizationID string `json:"externalOrganizationId,omitempty"`
	SupportsWebhookSetup   bool   `json:"supportsWebhookSetup"`
	SupportsQueryAPI       bool   `json:"supportsQueryApi"`
}

type OnAlertReceived

type OnAlertReceived struct{}

func (*OnAlertReceived) Actions

func (t *OnAlertReceived) Actions() []core.Action

func (*OnAlertReceived) Cleanup

func (t *OnAlertReceived) Cleanup(ctx core.TriggerContext) error

func (*OnAlertReceived) Color

func (t *OnAlertReceived) Color() string

func (*OnAlertReceived) Configuration

func (t *OnAlertReceived) Configuration() []configuration.Field

func (*OnAlertReceived) Description

func (t *OnAlertReceived) Description() string

func (*OnAlertReceived) Documentation

func (t *OnAlertReceived) Documentation() string

func (*OnAlertReceived) ExampleData

func (t *OnAlertReceived) ExampleData() map[string]any

func (*OnAlertReceived) HandleAction

func (t *OnAlertReceived) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)

func (*OnAlertReceived) HandleWebhook

func (*OnAlertReceived) Icon

func (t *OnAlertReceived) Icon() string

func (*OnAlertReceived) Label

func (t *OnAlertReceived) Label() string

func (*OnAlertReceived) Name

func (t *OnAlertReceived) Name() string

func (*OnAlertReceived) Setup

func (t *OnAlertReceived) Setup(ctx core.TriggerContext) error

type OnAlertReceivedNodeMetadata

type OnAlertReceivedNodeMetadata struct {
	Project *ProjectMetadata `json:"project,omitempty" mapstructure:"project"`
	Alert   *AlertMetadata   `json:"alert,omitempty" mapstructure:"alert"`
}

type Project

type Project struct {
	ID               string `json:"id"`
	OrganizationName string `json:"organization_name"`
	ProjectName      string `json:"project_name"`
}

type ProjectMetadata

type ProjectMetadata struct {
	ID   string `json:"id" mapstructure:"id"`
	Name string `json:"name" mapstructure:"name"`
}

type QueryLogfire

type QueryLogfire struct{}

func (*QueryLogfire) Actions

func (c *QueryLogfire) Actions() []core.Action

func (*QueryLogfire) Cancel

func (c *QueryLogfire) Cancel(ctx core.ExecutionContext) error

func (*QueryLogfire) Cleanup

func (c *QueryLogfire) Cleanup(ctx core.SetupContext) error

func (*QueryLogfire) Color

func (c *QueryLogfire) Color() string

func (*QueryLogfire) Configuration

func (c *QueryLogfire) Configuration() []configuration.Field

func (*QueryLogfire) Description

func (c *QueryLogfire) Description() string

func (*QueryLogfire) Documentation

func (c *QueryLogfire) Documentation() string

func (*QueryLogfire) ExampleOutput

func (c *QueryLogfire) ExampleOutput() map[string]any

func (*QueryLogfire) Execute

func (c *QueryLogfire) Execute(ctx core.ExecutionContext) error

func (*QueryLogfire) HandleAction

func (c *QueryLogfire) HandleAction(ctx core.ActionContext) error

func (*QueryLogfire) HandleWebhook

func (*QueryLogfire) Icon

func (c *QueryLogfire) Icon() string

func (*QueryLogfire) Label

func (c *QueryLogfire) Label() string

func (*QueryLogfire) Name

func (c *QueryLogfire) Name() string

func (*QueryLogfire) OutputChannels

func (c *QueryLogfire) OutputChannels(configuration any) []core.OutputChannel

func (*QueryLogfire) ProcessQueueItem

func (c *QueryLogfire) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*QueryLogfire) Setup

func (c *QueryLogfire) Setup(ctx core.SetupContext) error

type QueryLogfireConfiguration

type QueryLogfireConfiguration struct {
	SQL          string `json:"sql" mapstructure:"sql"`
	ProjectID    string `json:"project" mapstructure:"project"`
	TimeWindow   string `json:"timeWindow,omitempty" mapstructure:"timeWindow"`
	MinTimestamp string `json:"minTimestamp,omitempty" mapstructure:"minTimestamp"`
	MaxTimestamp string `json:"maxTimestamp,omitempty" mapstructure:"maxTimestamp"`
	Limit        int    `json:"limit,omitempty" mapstructure:"limit"`
	RowOriented  bool   `json:"rowOriented,omitempty" mapstructure:"rowOriented"`
}

type QueryLogfireNodeMetadata

type QueryLogfireNodeMetadata struct {
	Project *ProjectMetadata `json:"project,omitempty" mapstructure:"project"`
}

type QueryRequest

type QueryRequest struct {
	SQL          string `json:"sql"`
	MinTimestamp string `json:"min_timestamp,omitempty"`
	MaxTimestamp string `json:"max_timestamp,omitempty"`
	Limit        int    `json:"limit,omitempty"`
	RowOriented  bool   `json:"row_oriented,omitempty"`
}

type QueryResponse

type QueryResponse struct {
	Columns any `json:"columns,omitempty"`
	Rows    any `json:"rows,omitempty"`
}

Jump to

Keyboard shortcuts

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