Documentation
¶
Index ¶
- type Alert
- type AlertQuery
- type Block
- type BlockType
- type CreateIncidentInput
- type CreateTicketInput
- type Deployment
- type DeploymentQuery
- type Incident
- type IncidentQuery
- type LogEntry
- type LogExpression
- type LogFilter
- type LogQuery
- type Message
- type MessageResult
- type MetricDescriptor
- type MetricExpression
- type MetricFilter
- type MetricPoint
- type MetricQuery
- type MetricSeries
- type QueryScope
- type Service
- type ServiceQuery
- type Team
- type TeamMember
- type TeamQuery
- type Ticket
- type TicketQuery
- type TimelineAppendInput
- type TimelineEntry
- type UpdateIncidentInput
- type UpdateTicketInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶ added in v0.0.3
type Alert struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Severity string `json:"severity"`
Service string `json:"service,omitempty"`
URL string `json:"url,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Fields is a flexible bag for commonly useful, structured attributes
// (e.g. metric name, monitor/issue ID, hostname, region, tags).
Fields map[string]any `json:"fields,omitempty"`
// Metadata is for provider-specific payload fragments that don't map cleanly
// into the normalized shape (raw JSON, rule definitions, etc.).
Metadata map[string]any `json:"metadata,omitempty"`
}
Alert captures the normalized alert shape for the current schema revision. It is intentionally similar to Incident but represents a lower-level signal.
type AlertQuery ¶ added in v0.0.3
type AlertQuery struct {
// Query is a free-form search string providers can map to title/message or
// provider-specific search syntax.
Query string `json:"query,omitempty"`
// Statuses filters alerts by one or more normalized status values
// (e.g. "open", "closed", "firing", "resolved").
Statuses []string `json:"statuses,omitempty"`
// Severities filters alerts by normalized severity values
// (e.g. "info", "warning", "error", "critical", "P1").
Severities []string `json:"severities,omitempty"`
// Scope provides shared service/team/environment hints.
Scope QueryScope `json:"scope,omitempty"`
// Limit caps the maximum number of alerts returned.
Limit int `json:"limit,omitempty"`
// Metadata carries provider-specific filter hints (e.g. label selectors,
// monitor types, project IDs).
Metadata map[string]any `json:"metadata,omitempty"`
}
AlertQuery filters normalized alerts from the active alert provider. Providers choose how to map these hints to their upstream search/filter API.
type Block ¶
type Block struct {
Type BlockType `json:"type"`
Text string `json:"text,omitempty"`
Fields map[string]string `json:"fields,omitempty"`
}
Block represents a UI element in a message. Text fields support CommonMark Markdown. Adapters are responsible for converting this Markdown to the target platform's format (e.g., Slack mrkdwn).
type CreateIncidentInput ¶
type CreateIncidentInput struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Severity string `json:"severity"`
Service string `json:"service,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
CreateIncidentInput is the provider-agnostic payload for creating an incident.
type CreateTicketInput ¶
type CreateTicketInput struct {
Title string `json:"title"`
Description string `json:"description,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
CreateTicketInput defines the payload for ticket creation.
type Deployment ¶ added in v0.1.0
type Deployment struct {
// ID is the stable, normalized OpsOrch identifier for this deployment.
// Typically derived from the provider's unique field (run id, build id, deployment id).
ID string `json:"id"`
// Service is the canonical service name.
// Providers map this to repo/project/application identifiers and tags.
Service string `json:"service,omitempty"`
// Environment is a simple "prod", "staging", "dev"-style value.
// Providers map this to environment names, stages, or deployment targets.
Environment string `json:"environment,omitempty"`
// Version is a provider-agnostic identifier for the deployed version
// (image tag, semantic version, build number, ref, commit SHA).
Version string `json:"version,omitempty"`
// Status is the normalized deployment state
// (queued, running, success, failed, cancelled).
Status string `json:"status"`
// StartedAt is when the deployment began rolling out.
StartedAt time.Time `json:"startedAt"`
// FinishedAt is when the deployment completed (successfully or not).
FinishedAt time.Time `json:"finishedAt"`
// URL is the upstream link to the deployment (e.g. GitHub Actions run, Jenkins build).
URL string `json:"url,omitempty"`
// Actor represents who triggered the deployment.
Actor map[string]any `json:"actor,omitempty"`
// Fields is a flexible bag for commonly useful structured attributes
// (commit SHA, branch, pipeline/plan key, actor, URLs).
Fields map[string]any `json:"fields,omitempty"`
// Metadata is for provider-specific payload fragments that don't map cleanly into the
// normalized shape (raw JSON, upstream objects, etc.).
Metadata map[string]any `json:"metadata,omitempty"`
}
Deployment captures the normalized deployment shape for the current schema revision. OpsOrch only queries deployments in the initial iteration; providers own the source of truth.
type DeploymentQuery ¶ added in v0.1.0
type DeploymentQuery struct {
// Query is a free-form search string providers can map to ref, version,
// commit message, description, or provider-specific syntax.
Query string `json:"query,omitempty"`
// Statuses filters deployments by one or more normalized status values.
// Recommended normalized set: "queued", "running", "success", "failed", "cancelled".
Statuses []string `json:"statuses,omitempty"`
// Versions filters deployments by one or more version identifiers
// (e.g. image tag, semantic version, build label, ref, short SHA).
Versions []string `json:"versions,omitempty"`
// Scope provides shared service/team/environment hints. Providers can ignore fields
// they do not support.
Scope QueryScope `json:"scope,omitempty"`
// Limit caps the maximum number of deployments returned.
Limit int `json:"limit,omitempty"`
// Metadata carries provider-specific filter hints (e.g. project keys, pipeline IDs,
// repo identifiers, branch selectors).
Metadata map[string]any `json:"metadata,omitempty"`
}
DeploymentQuery filters normalized deployments from the active deployment provider. Providers choose how to map DeploymentQuery to their upstream search/filter API.
type Incident ¶
type Incident struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Severity string `json:"severity"`
Service string `json:"service,omitempty"`
URL string `json:"url,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Incident captures the normalized incident shape for the current schema revision.
type IncidentQuery ¶
type IncidentQuery struct {
// Query is a free-form search string providers can map to title, summary, or
// provider-specific search syntax.
Query string `json:"query,omitempty"`
// Statuses filters incidents by one or more normalized status values.
Statuses []string `json:"statuses,omitempty"`
// Severities filters incidents by normalized severity values.
Severities []string `json:"severities,omitempty"`
// Scope provides shared service/team/environment hints.
Scope QueryScope `json:"scope,omitempty"`
// Limit caps the maximum number of incidents returned.
Limit int `json:"limit,omitempty"`
// Metadata carries provider-specific filter hints.
Metadata map[string]any `json:"metadata,omitempty"`
}
IncidentQuery filters normalized incidents from the active incident provider. Providers choose how to map these hints to their upstream search/filter API.
type LogEntry ¶
type LogEntry struct {
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
Severity string `json:"severity,omitempty"`
Service string `json:"service,omitempty"`
URL string `json:"url,omitempty"`
Labels map[string]string `json:"labels,omitempty"` // filterable
Fields map[string]any `json:"fields,omitempty"` // structured JSON
Metadata map[string]any `json:"metadata,omitempty"` // provider-specific
}
LogEntry is a normalized log record.
type LogExpression ¶
type LogExpression struct {
Search string `json:"search,omitempty"` // Full-text search term
Filters []LogFilter `json:"filters,omitempty"` // Structured filters
SeverityIn []string `json:"severityIn,omitempty"` // Filter by severity levels
}
LogExpression defines structured log search criteria.
type LogFilter ¶
type LogFilter struct {
Field string `json:"field"` // Field name (e.g., "service", "message")
Operator string `json:"operator"` // "=", "!=", "contains", "regex"
Value string `json:"value"` // Filter value
}
LogFilter defines a field-level filter for logs.
type LogQuery ¶
type LogQuery struct {
Expression *LogExpression `json:"expression,omitempty"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Scope QueryScope `json:"scope,omitempty"`
Limit int `json:"limit,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
Providers []string `json:"providers,omitempty"`
}
LogQuery requests a slice of normalized log entries.
Example:
{
"expression": {
"search": "error connection",
"filters": [
{"field": "service", "operator": "=", "value": "api-gateway"},
{"field": "status", "operator": "!=", "value": "200"}
],
"severityIn": ["error", "critical"]
},
"start": "2023-10-01T00:00:00Z",
"end": "2023-10-01T01:00:00Z"
}
type MessageResult ¶
type MetricDescriptor ¶
type MetricDescriptor struct {
Name string `json:"name"` // Metric name (e.g., "http_requests_total")
Type string `json:"type"` // "counter", "gauge", "histogram"
Description string `json:"description"` // Human-readable description
Labels []string `json:"labels"` // Available label keys
Unit string `json:"unit,omitempty"` // "bytes", "seconds", "requests"
URL string `json:"url,omitempty"` // Upstream link to the metric (e.g. Prometheus expression browser)
Metadata map[string]any `json:"metadata,omitempty"` // Provider-specific metadata
}
MetricDescriptor describes an available metric for discovery.
type MetricExpression ¶
type MetricExpression struct {
MetricName string `json:"metricName"` // Required: metric name (e.g., "http_requests_total")
Aggregation string `json:"aggregation,omitempty"` // "avg", "sum", "max", "min", "count"
Filters []MetricFilter `json:"filters,omitempty"` // Label filters
GroupBy []string `json:"groupBy,omitempty"` // Label keys to group by
}
MetricExpression defines structured metric selection criteria.
type MetricFilter ¶
type MetricFilter struct {
Label string `json:"label"` // Label key
Operator string `json:"operator"` // "=", "!=", "=~", "!~"
Value string `json:"value"` // Filter value
}
MetricFilter defines a label-based filter for metrics.
type MetricPoint ¶
MetricPoint represents a single value in a series.
type MetricQuery ¶
type MetricQuery struct {
Expression *MetricExpression `json:"expression,omitempty"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Step int `json:"step"` // in seconds
Scope QueryScope `json:"scope,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
MetricQuery specifies a time-series request.
Example:
{
"expression": {
"metricName": "http_requests_total",
"aggregation": "sum",
"filters": [
{"label": "method", "operator": "=", "value": "POST"}
],
"groupBy": ["service", "status"]
},
"start": "2023-10-01T00:00:00Z",
"end": "2023-10-01T01:00:00Z",
"step": 60
}
type MetricSeries ¶
type MetricSeries struct {
Name string `json:"name"`
Service string `json:"service,omitempty"`
Labels map[string]any `json:"labels,omitempty"`
Points []MetricPoint `json:"points"`
URL string `json:"url,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
MetricSeries is a normalized collection of metric points.
type QueryScope ¶
type QueryScope struct {
// Service is the canonical service name.
// Providers map this to service tags, project IDs, components, etc.
Service string `json:"service,omitempty"`
// Team is the team owning the workload or resource.
// Providers map this to escalation policies, Jira components, Datadog tags, etc.
Team string `json:"team,omitempty"`
// Environment is a simple "prod", "staging", "dev"-style filter.
// Providers map this to labels/tags in their own systems.
Environment string `json:"environment,omitempty"`
}
QueryScope is the minimal shared filter used across all OpsOrch queries. Providers can choose to ignore fields they don't understand.
type Service ¶
type Service struct {
// ID is the stable, normalized OpsOrch identifier for this service.
// Typically derived from the provider's unique field (e.g. UID, ID, slug).
ID string `json:"id"`
// Name is the human-readable display name of the service.
// Providers may map this from title, name, alias, or other upstream fields.
Name string `json:"name"`
// URL is the deep link to the service in the provider's UI.
URL string `json:"url,omitempty"`
// Tags contains normalized key/value tags for filtering and correlation.
// Providers flatten their native tag/label formats into string pairs.
Tags map[string]string `json:"tags,omitempty"`
// Metadata stores provider-specific fields not covered by the normalized schema.
// Providers may include raw upstream objects, attributes, or extended data here.
Metadata map[string]any `json:"metadata,omitempty"`
}
Service represents a normalized service definition from the active service provider. OpsOrch does not create, modify, or delete services; providers own the source of truth.
type ServiceQuery ¶
type ServiceQuery struct {
// IDs filters services by their normalized OpsOrch ID.
// Providers can map this to their upstream "id", "uid", or similar fields.
IDs []string `json:"ids,omitempty"`
// Name is a substring / fuzzy match filter for service names.
// Providers typically match this against their display name or slug.
Name string `json:"name,omitempty"`
// Tags filters services by key/value tag pairs.
// Providers may match these to labels, tags, attributes, or custom metadata.
Tags map[string]string `json:"tags,omitempty"`
// Limit restricts the maximum number of services returned.
// Providers may apply this server-side or let OpsOrch slice results.
Limit int `json:"limit,omitempty"`
// Scope provides a shared set of filtering hints applied across providers.
// Providers can ignore fields they do not support.
Scope QueryScope `json:"scope,omitempty"`
// Metadata carries provider-specific query hints.
// This is an escape hatch: adapters may interpret these fields as needed.
Metadata map[string]any `json:"metadata,omitempty"`
}
ServiceQuery defines filters passed to the single active service provider. Providers decide how to apply these filters (server-side or client-side).
type Team ¶ added in v0.2.0
type Team struct {
// ID is the canonical OpsOrch handle for this team.
// This is what QueryScope.Team should carry.
ID string `json:"id"`
// Name is the human-readable display name of the team.
Name string `json:"name"`
// Parent is the canonical ID of this team's parent, if any.
// Root-level teams leave this empty. Call the team provider's Get with this
// value if you need the parent details.
Parent string `json:"parent,omitempty"`
// URL is the deep link to the team in the provider's UI.
URL string `json:"url,omitempty"`
// Tags contains normalized key/value tags for filtering and correlation.
Tags map[string]string `json:"tags,omitempty"`
// Metadata stores provider-specific fields not covered by the normalized schema.
Metadata map[string]any `json:"metadata,omitempty"`
}
Team represents a normalized team or group from the active team provider. OpsOrch does not store or mutate teams; providers own the source of truth.
type TeamMember ¶ added in v0.2.0
type TeamMember struct {
// ID is the canonical handle for this person within OpsOrch.
// Providers can map this to a user ID, email, or any stable upstream identifier.
ID string `json:"id"`
// Name is the display name for this member.
Name string `json:"name,omitempty"`
// Email is often the most stable handle for routing notifications, etc.
Email string `json:"email,omitempty"`
// Handle can be a chat/username (Slack handle, GitHub login, etc.).
Handle string `json:"handle,omitempty"`
// Role is a free-form normalized label like "owner", "manager", "member", "oncall".
Role string `json:"role,omitempty"`
// Metadata is provider-specific: raw user object, links, extra attributes, etc.
Metadata map[string]any `json:"metadata,omitempty"`
}
TeamMember is a lightweight, provider-backed representation of a team member. OpsOrch does not manage identities; this is a best-effort snapshot.
type TeamQuery ¶ added in v0.2.0
type TeamQuery struct {
// Name is a substring / fuzzy match filter for team names.
// Used for discovery (autocomplete, UIs, MCP listing, etc.).
Name string `json:"name,omitempty"`
// Tags filters teams by key/value tag pairs.
// Providers may map these to labels, attributes, or custom metadata.
Tags map[string]string `json:"tags,omitempty"`
// Scope provides shared service/team/environment hints.
// Providers can ignore fields they do not support.
Scope QueryScope `json:"scope,omitempty"`
// Metadata carries provider-specific query hints.
Metadata map[string]any `json:"metadata,omitempty"`
}
TeamQuery defines filters passed to the active team provider. Providers decide how to apply these hints (server-side or client-side).
type Ticket ¶
type Ticket struct {
ID string `json:"id"`
Key string `json:"key,omitempty"`
Title string `json:"title"`
Description string `json:"description,omitempty"`
Status string `json:"status"`
Assignees []string `json:"assignees,omitempty"`
Reporter string `json:"reporter,omitempty"`
URL string `json:"url,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Ticket is a normalized representation of a work item.
type TicketQuery ¶
type TicketQuery struct {
Query string `json:"query,omitempty"`
Statuses []string `json:"statuses,omitempty"`
Assignees []string `json:"assignees,omitempty"`
Reporter string `json:"reporter,omitempty"`
Scope QueryScope `json:"scope,omitempty"`
Limit int `json:"limit,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TicketQuery defines filters for querying tickets. Query is a free-form search string providers can map to JQL, name, description, etc.
type TimelineAppendInput ¶
type TimelineAppendInput struct {
At time.Time `json:"at"`
Kind string `json:"kind"`
Body string `json:"body"`
Actor map[string]any `json:"actor,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TimelineAppendInput is used to append to an incident timeline.
type TimelineEntry ¶
type TimelineEntry struct {
ID string `json:"id"`
IncidentID string `json:"incidentId"`
At time.Time `json:"at"`
Kind string `json:"kind"`
Body string `json:"body"`
Actor map[string]any `json:"actor,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TimelineEntry represents a single entry on an incident timeline.
type UpdateIncidentInput ¶
type UpdateIncidentInput struct {
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
Status *string `json:"status,omitempty"`
Severity *string `json:"severity,omitempty"`
Service *string `json:"service,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
UpdateIncidentInput defines mutable fields on an incident.
type UpdateTicketInput ¶
type UpdateTicketInput struct {
Title *string `json:"title,omitempty"`
Description *string `json:"description,omitempty"`
Status *string `json:"status,omitempty"`
Assignees *[]string `json:"assignees,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
UpdateTicketInput defines mutable fields on a ticket.