mackerel

package module
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 141

README

mackerel-client-go

Build Status pkg.go.dev

mackerel-client-go is a Go client library for mackerel.io API.

Usage

import "github.com/mackerelio/mackerel-client-go"
client := mackerel.NewClient("<Put your API key>")

hosts, err := client.FindHosts(&mackerel.FindHostsParam{
        Service: "My-Service",
        Roles: []string{"proxy"},
        Statuses: []string{mackerel.HostStatusWorking},
})

err := client.PostServiceMetricValues("My-Service", []*mackerel.MetricValue{
        &mackerel.MetricValue{
              Name:  "proxy.access_log.latency",
              Time:  123456789,
              Value: 500,
        },
})

CAUTION

Now, mackerel-client-go is an ALPHA version. In the future release, it may change it's interface.

CONTRIBUTION

  1. Fork (https://github.com/mackerelio/mackerel-client-go/fork)
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

Copyright 2014 Hatena Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

View Source
const (
	// HostStatusWorking represents "working" status
	HostStatusWorking = "working"
	// HostStatusStandby represents "standby" status
	HostStatusStandby = "standby"
	// HostStatusMaintenance represents "maintenance" status
	HostStatusMaintenance = "maintenance"
	// HostStatusPoweroff represents "poeroff" status
	HostStatusPoweroff = "poweroff"
)
View Source
const (
	ValueTypeString = "string"
	ValueTypeBool   = "bool"
	ValueTypeInt    = "int"
	ValueTypeDouble = "double"
	ValueTypeArray  = "array"
	ValueTypeKvlist = "kvlist"
	ValueTypeBytes  = "bytes"
	ValueTypeEmpty  = "empty"
)

AttributeValue type constants

Variables

This section is empty.

Functions

func ToPtr added in v0.37.0

func ToPtr[T any](v T) *T

ToPtr returns a pointer to the given value of any type.

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
}

APIError represents the error type from Mackerel API.

func (*APIError) Error

func (err *APIError) Error() string

type AWSIntegration added in v0.18.0

type AWSIntegration struct {
	ID           string                            `json:"id"`
	Name         string                            `json:"name"`
	Memo         string                            `json:"memo"`
	Key          string                            `json:"key,omitempty"`
	RoleArn      string                            `json:"roleArn,omitempty"`
	ExternalID   string                            `json:"externalId,omitempty"`
	Region       string                            `json:"region"`
	IncludedTags string                            `json:"includedTags"`
	ExcludedTags string                            `json:"excludedTags"`
	Services     map[string]*AWSIntegrationService `json:"services"`
}

AWSIntegration AWS integration information

type AWSIntegrationService added in v0.18.0

type AWSIntegrationService struct {
	Enable              bool     `json:"enable"`
	Role                *string  `json:"role"`
	IncludedMetrics     []string `json:"includedMetrics"`
	ExcludedMetrics     []string `json:"excludedMetrics"`
	RetireAutomatically bool     `json:"retireAutomatically,omitempty"`
}

AWSIntegrationService integration settings for each AWS service

func (*AWSIntegrationService) MarshalJSON added in v0.28.0

func (a *AWSIntegrationService) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

type Alert

type Alert struct {
	ID        string  `json:"id,omitempty"`
	Status    string  `json:"status,omitempty"`
	MonitorID string  `json:"monitorId,omitempty"`
	Type      string  `json:"type,omitempty"`
	HostID    string  `json:"hostId,omitempty"`
	Value     float64 `json:"value,omitempty"`
	Message   string  `json:"message,omitempty"`
	Reason    string  `json:"reason,omitempty"`
	OpenedAt  int64   `json:"openedAt,omitempty"`
	ClosedAt  int64   `json:"closedAt,omitempty"`
	Memo      string  `json:"memo,omitempty"`
}

Alert information

type AlertGroupSetting added in v0.11.0

type AlertGroupSetting struct {
	ID                   string   `json:"id,omitempty"`
	Name                 string   `json:"name"`
	Memo                 string   `json:"memo,omitempty"`
	ServiceScopes        []string `json:"serviceScopes,omitempty"`
	RoleScopes           []string `json:"roleScopes,omitempty"`
	MonitorScopes        []string `json:"monitorScopes,omitempty"`
	NotificationInterval uint64   `json:"notificationInterval,omitempty"`
}

AlertGroupSetting represents a Mackerel alert group setting. ref. https://mackerel.io/api-docs/entry/alert-group-settings

type AlertLog added in v0.37.0

type AlertLog struct {
	ID           string   `json:"id"`
	CreatedAt    int64    `json:"createdAt"`
	Status       string   `json:"status"`
	Trigger      string   `json:"trigger"`
	MonitorID    *string  `json:"monitorId"`
	TargetValue  *float64 `json:"targetValue"`
	StatusDetail *struct {
		Type   string `json:"type"`
		Detail struct {
			Message string `json:"message"`
			Memo    string `json:"memo"`
		} `json:"detail"`
	} `json:"statusDetail,omitempty"`
}

AlertLog is the log of alert See https://mackerel.io/api-docs/entry/alerts#logs

type AlertsResp added in v0.1.0

type AlertsResp struct {
	Alerts []*Alert `json:"alerts"`
	NextID string   `json:"nextId,omitempty"`
}

AlertsResp includes alert and next id

type Attribute added in v0.38.0

type Attribute struct {
	Key   string          `json:"key"`
	Value *AttributeValue `json:"value"`
}

Attribute represents a span attribute

type AttributeValue added in v0.38.0

type AttributeValue struct {
	ValueType   string                     `json:"valueType"`
	StringValue string                     `json:"stringValue,omitempty"`
	BoolValue   bool                       `json:"boolValue,omitempty"`
	IntValue    int64                      `json:"intValue,omitempty"`
	DoubleValue float64                    `json:"doubleValue,omitempty"`
	ArrayValue  []*AttributeValue          `json:"arrayValue,omitempty"`
	KvlistValue map[string]*AttributeValue `json:"kvlistValue,omitempty"`
	BytesValue  []byte                     `json:"bytesValue,omitempty"`
}

AttributeValue represents a value that can be of different types

type BlockDevice

type BlockDevice map[string]map[string]any

BlockDevice blockdevice

type CPU

type CPU []map[string]any

CPU cpu

type Channel added in v0.9.0

type Channel struct {
	// ID is excluded when used to call CreateChannel
	ID string `json:"id,omitempty"`

	Name string `json:"name"`
	Type string `json:"type"`

	SuspendedAt *int64 `json:"suspendedAt,omitempty"`

	// Exists when the type is "email"
	Emails  *[]string `json:"emails,omitempty"`
	UserIDs *[]string `json:"userIds,omitempty"`

	// Exists when the type is "slack"
	Mentions Mentions `json:"mentions,omitempty"`
	// In order to support both 'not setting this field' and 'setting the field as false',
	// this field needed to be *bool not bool.
	EnabledGraphImage *bool `json:"enabledGraphImage,omitempty"`

	// Exists when the type is "slack" or "webhook"
	URL string `json:"url,omitempty"`

	// Exists when the type is "email", "slack", or "webhook"
	Events *[]string `json:"events,omitempty"`

	// AddToDefaultNotificationGroup when the type is "email", "slack", or "webhook", only CreateChannel, CreateChannelContext
	AddToDefaultNotificationGroup *bool `json:"addToDefaultNotificationGroup,omitempty"`
}

Channel represents a Mackerel notification channel. ref. https://mackerel.io/api-docs/entry/channels

type CheckConfig

type CheckConfig struct {
	Name string `json:"name,omitempty"`
	Memo string `json:"memo,omitempty"`
}

CheckConfig is check plugin name and memo

type CheckReport

type CheckReport struct {
	Source               CheckSource `json:"source"`
	Name                 string      `json:"name"`
	Status               CheckStatus `json:"status"`
	Message              string      `json:"message"`
	OccurredAt           int64       `json:"occurredAt"`
	NotificationInterval uint        `json:"notificationInterval,omitempty"`
	MaxCheckAttempts     uint        `json:"maxCheckAttempts,omitempty"`
}

CheckReport represents a report of check monitoring

type CheckReports

type CheckReports struct {
	Reports []*CheckReport `json:"reports"`
}

CheckReports represents check reports for API

type CheckSource

type CheckSource interface {
	CheckType() string
	// contains filtered or unexported methods
}

CheckSource represents interface to which each check source type must confirm to

func NewCheckSourceHost

func NewCheckSourceHost(hostID string) CheckSource

NewCheckSourceHost returns new CheckSource which check type is "host"

type CheckStatus

type CheckStatus string

CheckStatus represents check monitoring status

const (
	CheckStatusOK       CheckStatus = "OK"
	CheckStatusWarning  CheckStatus = "WARNING"
	CheckStatusCritical CheckStatus = "CRITICAL"
	CheckStatusUnknown  CheckStatus = "UNKNOWN"
)

CheckStatuses

type Client

type Client struct {
	BaseURL           *url.URL
	APIKey            string
	Verbose           bool
	UserAgent         string
	AdditionalHeaders http.Header
	HTTPClient        *http.Client

	// Client will send logging events to both Logger and PrioritizedLogger.
	// When neither Logger or PrioritizedLogger is set, the log package's standard logger will be used.
	Logger            *log.Logger
	PrioritizedLogger PrioritizedLogger
}

Client api client for mackerel

func NewClient

func NewClient(apikey string) *Client

NewClient returns new mackerel.Client

func NewClientWithOptions

func NewClientWithOptions(apikey string, rawurl string, verbose bool) (*Client, error)

NewClientWithOptions returns new mackerel.Client

func (*Client) BulkRetireHosts added in v0.22.0

func (c *Client) BulkRetireHosts(ids []string) error

BulkRetireHosts retires the hosts.

func (*Client) BulkRetireHostsContext added in v0.40.0

func (c *Client) BulkRetireHostsContext(ctx context.Context, ids []string) error

BulkRetireHostsContext retires the hosts.

func (*Client) BulkUpdateHostStatuses added in v0.28.0

func (c *Client) BulkUpdateHostStatuses(ids []string, status string) error

BulkUpdateHostStatuses updates status of the hosts.

func (*Client) BulkUpdateHostStatusesContext added in v0.40.0

func (c *Client) BulkUpdateHostStatusesContext(ctx context.Context, ids []string, status string) error

BulkUpdateHostStatusesContext updates status of the hosts.

func (*Client) CloseAlert

func (c *Client) CloseAlert(alertID string, reason string) (*Alert, error)

CloseAlert closes an alert.

func (*Client) CloseAlertContext added in v0.40.0

func (c *Client) CloseAlertContext(ctx context.Context, alertID string, reason string) (*Alert, error)

CloseAlertContext closes an alert.

func (*Client) CreateAWSIntegration added in v0.18.0

func (c *Client) CreateAWSIntegration(param *CreateAWSIntegrationParam) (*AWSIntegration, error)

CreateAWSIntegration creates an AWS integration setting.

func (*Client) CreateAWSIntegrationContext added in v0.40.0

func (c *Client) CreateAWSIntegrationContext(ctx context.Context, param *CreateAWSIntegrationParam) (*AWSIntegration, error)

CreateAWSIntegrationContext creates an AWS integration setting.

func (*Client) CreateAWSIntegrationExternalID added in v0.18.0

func (c *Client) CreateAWSIntegrationExternalID() (string, error)

CreateAWSIntegrationExternalID creates an AWS integration External ID.

func (*Client) CreateAWSIntegrationExternalIDContext added in v0.40.0

func (c *Client) CreateAWSIntegrationExternalIDContext(ctx context.Context) (string, error)

CreateAWSIntegrationExternalIDContext creates an AWS integration External ID.

func (*Client) CreateAlertGroupSetting added in v0.11.0

func (c *Client) CreateAlertGroupSetting(param *AlertGroupSetting) (*AlertGroupSetting, error)

CreateAlertGroupSetting creates an alert group setting.

func (*Client) CreateAlertGroupSettingContext added in v0.40.0

func (c *Client) CreateAlertGroupSettingContext(ctx context.Context, param *AlertGroupSetting) (*AlertGroupSetting, error)

CreateAlertGroupSettingContext creates an alert group setting.

func (*Client) CreateChannel added in v0.9.0

func (c *Client) CreateChannel(param *Channel) (*Channel, error)

CreateChannel creates a channel.

func (*Client) CreateChannelContext added in v0.40.0

func (c *Client) CreateChannelContext(ctx context.Context, param *Channel) (*Channel, error)

CreateChannelContext creates a channel.

func (*Client) CreateDashboard

func (c *Client) CreateDashboard(param *Dashboard) (*Dashboard, error)

CreateDashboard creates a dashboard.

func (*Client) CreateDashboardContext added in v0.40.0

func (c *Client) CreateDashboardContext(ctx context.Context, param *Dashboard) (*Dashboard, error)

CreateDashboardContext creates a dashboard.

func (*Client) CreateDowntime added in v0.8.0

func (c *Client) CreateDowntime(param *Downtime) (*Downtime, error)

CreateDowntime creates a downtime.

func (*Client) CreateDowntimeContext added in v0.40.0

func (c *Client) CreateDowntimeContext(ctx context.Context, param *Downtime) (*Downtime, error)

CreateDowntimeContext creates a downtime.

func (*Client) CreateGraphAnnotation

func (c *Client) CreateGraphAnnotation(annotation *GraphAnnotation) (*GraphAnnotation, error)

CreateGraphAnnotation creates a graph annotation.

func (*Client) CreateGraphAnnotationContext added in v0.40.0

func (c *Client) CreateGraphAnnotationContext(ctx context.Context, annotation *GraphAnnotation) (*GraphAnnotation, error)

CreateGraphAnnotationContext creates a graph annotation.

func (*Client) CreateGraphDefs

func (c *Client) CreateGraphDefs(graphDefs []*GraphDefsParam) error

CreateGraphDefs creates graph definitions.

func (*Client) CreateGraphDefsContext added in v0.40.0

func (c *Client) CreateGraphDefsContext(ctx context.Context, graphDefs []*GraphDefsParam) error

CreateGraphDefsContext creates graph definitions.

func (*Client) CreateHost

func (c *Client) CreateHost(param *CreateHostParam) (string, error)

CreateHost creates a host.

func (*Client) CreateHostContext added in v0.40.0

func (c *Client) CreateHostContext(ctx context.Context, param *CreateHostParam) (string, error)

CreateHostContext creates a host.

func (*Client) CreateInvitation added in v0.35.0

func (c *Client) CreateInvitation(param *Invitation) (*Invitation, error)

CreateInvitation creates a invitation.

func (*Client) CreateInvitationContext added in v0.40.0

func (c *Client) CreateInvitationContext(ctx context.Context, param *Invitation) (*Invitation, error)

CreateInvitationContext creates a invitation.

func (*Client) CreateMonitor

func (c *Client) CreateMonitor(param Monitor) (Monitor, error)

CreateMonitor creates a monitor.

func (*Client) CreateMonitorContext added in v0.40.0

func (c *Client) CreateMonitorContext(ctx context.Context, param Monitor) (Monitor, error)

CreateMonitorContext creates a monitor.

func (*Client) CreateNotificationGroup added in v0.10.0

func (c *Client) CreateNotificationGroup(param *NotificationGroup) (*NotificationGroup, error)

CreateNotificationGroup creates a notification group.

func (*Client) CreateNotificationGroupContext added in v0.40.0

func (c *Client) CreateNotificationGroupContext(ctx context.Context, param *NotificationGroup) (*NotificationGroup, error)

CreateNotificationGroupContext creates a notification group.

func (*Client) CreateRole

func (c *Client) CreateRole(serviceName string, param *CreateRoleParam) (*Role, error)

CreateRole creates a role.

func (*Client) CreateRoleContext added in v0.40.0

func (c *Client) CreateRoleContext(ctx context.Context, serviceName string, param *CreateRoleParam) (*Role, error)

CreateRoleContext creates a role.

func (*Client) CreateService

func (c *Client) CreateService(param *CreateServiceParam) (*Service, error)

CreateService creates a service.

func (*Client) CreateServiceContext added in v0.40.0

func (c *Client) CreateServiceContext(ctx context.Context, param *CreateServiceParam) (*Service, error)

CreateServiceContext creates a service.

func (*Client) DeleteAWSIntegration added in v0.18.0

func (c *Client) DeleteAWSIntegration(awsIntegrationID string) (*AWSIntegration, error)

DeleteAWSIntegration deletes an AWS integration setting.

func (*Client) DeleteAWSIntegrationContext added in v0.40.0

func (c *Client) DeleteAWSIntegrationContext(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)

DeleteAWSIntegrationContext deletes an AWS integration setting.

func (*Client) DeleteAlertGroupSetting added in v0.11.0

func (c *Client) DeleteAlertGroupSetting(id string) (*AlertGroupSetting, error)

DeleteAlertGroupSetting deletes an alert group setting.

func (*Client) DeleteAlertGroupSettingContext added in v0.40.0

func (c *Client) DeleteAlertGroupSettingContext(ctx context.Context, id string) (*AlertGroupSetting, error)

DeleteAlertGroupSettingContext deletes an alert group setting.

func (*Client) DeleteChannel added in v0.9.0

func (c *Client) DeleteChannel(channelID string) (*Channel, error)

DeleteChannel deletes a channel.

func (*Client) DeleteChannelContext added in v0.40.0

func (c *Client) DeleteChannelContext(ctx context.Context, channelID string) (*Channel, error)

DeleteChannelContext deletes a channel.

func (*Client) DeleteDashboard

func (c *Client) DeleteDashboard(dashboardID string) (*Dashboard, error)

DeleteDashboard deletes a dashboard.

func (*Client) DeleteDashboardContext added in v0.40.0

func (c *Client) DeleteDashboardContext(ctx context.Context, dashboardID string) (*Dashboard, error)

DeleteDashboardContext deletes a dashboard.

func (*Client) DeleteDowntime added in v0.8.0

func (c *Client) DeleteDowntime(downtimeID string) (*Downtime, error)

DeleteDowntime deletes a downtime.

func (*Client) DeleteDowntimeContext added in v0.40.0

func (c *Client) DeleteDowntimeContext(ctx context.Context, downtimeID string) (*Downtime, error)

DeleteDowntimeContext deletes a downtime.

func (*Client) DeleteGraphAnnotation

func (c *Client) DeleteGraphAnnotation(annotationID string) (*GraphAnnotation, error)

DeleteGraphAnnotation deletes a graph annotation.

func (*Client) DeleteGraphAnnotationContext added in v0.40.0

func (c *Client) DeleteGraphAnnotationContext(ctx context.Context, annotationID string) (*GraphAnnotation, error)

DeleteGraphAnnotationContext deletes a graph annotation.

func (*Client) DeleteGraphDef added in v0.33.0

func (c *Client) DeleteGraphDef(name string) error

DeleteGraphDef deletes a graph definition.

func (*Client) DeleteGraphDefContext added in v0.40.0

func (c *Client) DeleteGraphDefContext(ctx context.Context, name string) error

DeleteGraphDefContext deletes a graph definition.

func (*Client) DeleteHostMetaData

func (c *Client) DeleteHostMetaData(hostID, namespace string) error

DeleteHostMetaData deletes a host metadata.

func (*Client) DeleteHostMetaDataContext added in v0.40.0

func (c *Client) DeleteHostMetaDataContext(ctx context.Context, hostID, namespace string) error

DeleteHostMetaDataContext deletes a host metadata.

func (*Client) DeleteMonitor

func (c *Client) DeleteMonitor(monitorID string) (Monitor, error)

DeleteMonitor updates a monitor.

func (*Client) DeleteMonitorContext added in v0.40.0

func (c *Client) DeleteMonitorContext(ctx context.Context, monitorID string) (Monitor, error)

DeleteMonitorContext updates a monitor.

func (*Client) DeleteNotificationGroup added in v0.10.0

func (c *Client) DeleteNotificationGroup(id string) (*NotificationGroup, error)

DeleteNotificationGroup deletes a notification group.

func (*Client) DeleteNotificationGroupContext added in v0.40.0

func (c *Client) DeleteNotificationGroupContext(ctx context.Context, id string) (*NotificationGroup, error)

DeleteNotificationGroupContext deletes a notification group.

func (*Client) DeleteRole

func (c *Client) DeleteRole(serviceName, roleName string) (*Role, error)

DeleteRole deletes a role.

func (*Client) DeleteRoleContext added in v0.38.0

func (c *Client) DeleteRoleContext(ctx context.Context, serviceName, roleName string) (*Role, error)

DeleteRoleContext is like [DeleteRole].

func (*Client) DeleteRoleMetaData

func (c *Client) DeleteRoleMetaData(serviceName, roleName, namespace string) error

DeleteRoleMetaData deletes a role metadata.

func (*Client) DeleteRoleMetaDataContext added in v0.38.0

func (c *Client) DeleteRoleMetaDataContext(ctx context.Context, serviceName, roleName, namespace string) error

DeleteRoleMetaDataContext is like [DeleteRoleMetaData].

func (*Client) DeleteService

func (c *Client) DeleteService(serviceName string) (*Service, error)

DeleteService deletes a service.

func (*Client) DeleteServiceContext added in v0.38.0

func (c *Client) DeleteServiceContext(ctx context.Context, serviceName string) (*Service, error)

DeleteServiceContext is like [DeleteService].

func (*Client) DeleteServiceGraphDef added in v0.35.0

func (c *Client) DeleteServiceGraphDef(serviceName string, graphName string) error

DeleteServiceGraphDef deletes a service metrics graph definition.

func (*Client) DeleteServiceGraphDefContext added in v0.38.0

func (c *Client) DeleteServiceGraphDefContext(ctx context.Context, serviceName string, graphName string) error

DeleteServiceGraphDefContext is like [DeleteServiceGraphDef].

func (*Client) DeleteServiceMetaData

func (c *Client) DeleteServiceMetaData(serviceName, namespace string) error

DeleteServiceMetaData deletes a service metadata.

func (*Client) DeleteServiceMetaDataContext added in v0.38.0

func (c *Client) DeleteServiceMetaDataContext(ctx context.Context, serviceName, namespace string) error

DeleteServiceMetaDataContext is like [DeleteServiceMetaData].

func (*Client) DeleteUser added in v0.7.0

func (c *Client) DeleteUser(userID string) (*User, error)

DeleteUser deletes a user.

func (*Client) DeleteUserContext added in v0.38.0

func (c *Client) DeleteUserContext(ctx context.Context, userID string) (*User, error)

DeleteUserContext is like [DeleteUser].

func (*Client) FetchHostMetricValues

func (c *Client) FetchHostMetricValues(hostID string, metricName string, from int64, to int64) ([]MetricValue, error)

FetchHostMetricValues fetches the metric values for a host.

func (*Client) FetchHostMetricValuesContext added in v0.40.0

func (c *Client) FetchHostMetricValuesContext(ctx context.Context, hostID string, metricName string, from int64, to int64) ([]MetricValue, error)

FetchHostMetricValuesContext fetches the metric values for a host.

func (*Client) FetchLatestMetricValues

func (c *Client) FetchLatestMetricValues(hostIDs []string, metricNames []string) (LatestMetricValues, error)

FetchLatestMetricValues fetches latest metrics.

func (*Client) FetchLatestMetricValuesContext added in v0.40.0

func (c *Client) FetchLatestMetricValuesContext(ctx context.Context, hostIDs []string, metricNames []string) (LatestMetricValues, error)

FetchLatestMetricValuesContext fetches latest metrics.

func (*Client) FetchServiceMetricValues

func (c *Client) FetchServiceMetricValues(serviceName string, metricName string, from int64, to int64) ([]MetricValue, error)

FetchServiceMetricValues fetches the metric values for a service.

func (*Client) FetchServiceMetricValuesContext added in v0.40.0

func (c *Client) FetchServiceMetricValuesContext(ctx context.Context, serviceName string, metricName string, from int64, to int64) ([]MetricValue, error)

FetchServiceMetricValuesContext fetches the metric values for a service.

func (*Client) FindAWSIntegration added in v0.18.0

func (c *Client) FindAWSIntegration(awsIntegrationID string) (*AWSIntegration, error)

FindAWSIntegration finds an AWS integration setting.

func (*Client) FindAWSIntegrationContext added in v0.40.0

func (c *Client) FindAWSIntegrationContext(ctx context.Context, awsIntegrationID string) (*AWSIntegration, error)

FindAWSIntegrationContext finds an AWS integration setting.

func (*Client) FindAWSIntegrations added in v0.18.0

func (c *Client) FindAWSIntegrations() ([]*AWSIntegration, error)

FindAWSIntegrations finds AWS integration settings.

func (*Client) FindAWSIntegrationsContext added in v0.40.0

func (c *Client) FindAWSIntegrationsContext(ctx context.Context) ([]*AWSIntegration, error)

FindAWSIntegrationsContext finds AWS integration settings.

func (*Client) FindAlertGroupSettings added in v0.11.0

func (c *Client) FindAlertGroupSettings() ([]*AlertGroupSetting, error)

FindAlertGroupSettings finds alert group settings.

func (*Client) FindAlertGroupSettingsContext added in v0.40.0

func (c *Client) FindAlertGroupSettingsContext(ctx context.Context) ([]*AlertGroupSetting, error)

FindAlertGroupSettingsContext finds alert group settings.

func (*Client) FindAlertLogs added in v0.37.0

func (c *Client) FindAlertLogs(alertId string, params *FindAlertLogsParam) (*FindAlertLogsResp, error)

FindAlertLogs gets alert logs.

func (*Client) FindAlertLogsContext added in v0.40.0

func (c *Client) FindAlertLogsContext(ctx context.Context, alertId string, params *FindAlertLogsParam) (*FindAlertLogsResp, error)

FindAlertLogsContext gets alert logs.

func (*Client) FindAlerts

func (c *Client) FindAlerts() (*AlertsResp, error)

FindAlerts finds open alerts.

func (*Client) FindAlertsByNextID added in v0.1.0

func (c *Client) FindAlertsByNextID(nextID string) (*AlertsResp, error)

FindAlertsByNextID finds next open alerts by next id.

func (*Client) FindAlertsByNextIDContext added in v0.40.0

func (c *Client) FindAlertsByNextIDContext(ctx context.Context, nextID string) (*AlertsResp, error)

FindAlertsByNextIDContext finds next open alerts by next id.

func (*Client) FindAlertsContext added in v0.40.0

func (c *Client) FindAlertsContext(ctx context.Context) (*AlertsResp, error)

FindAlertsContext finds open alerts.

func (*Client) FindChannels added in v0.9.0

func (c *Client) FindChannels() ([]*Channel, error)

FindChannels finds channels.

func (*Client) FindChannelsContext added in v0.40.0

func (c *Client) FindChannelsContext(ctx context.Context) ([]*Channel, error)

FindChannelsContext finds channels.

func (*Client) FindDashboard

func (c *Client) FindDashboard(dashboardID string) (*Dashboard, error)

FindDashboard finds a dashboard.

func (*Client) FindDashboardContext added in v0.40.0

func (c *Client) FindDashboardContext(ctx context.Context, dashboardID string) (*Dashboard, error)

FindDashboardContext finds a dashboard.

func (*Client) FindDashboards

func (c *Client) FindDashboards() ([]*Dashboard, error)

FindDashboards finds dashboards.

func (*Client) FindDashboardsContext added in v0.40.0

func (c *Client) FindDashboardsContext(ctx context.Context) ([]*Dashboard, error)

FindDashboardsContext finds dashboards.

func (*Client) FindDowntimes added in v0.8.0

func (c *Client) FindDowntimes() ([]*Downtime, error)

FindDowntimes finds downtimes.

func (*Client) FindDowntimesContext added in v0.40.0

func (c *Client) FindDowntimesContext(ctx context.Context) ([]*Downtime, error)

FindDowntimesContext finds downtimes.

func (*Client) FindGraphAnnotations

func (c *Client) FindGraphAnnotations(service string, from int64, to int64) ([]*GraphAnnotation, error)

FindGraphAnnotations fetches graph annotations.

func (*Client) FindGraphAnnotationsContext added in v0.40.0

func (c *Client) FindGraphAnnotationsContext(ctx context.Context, service string, from int64, to int64) ([]*GraphAnnotation, error)

FindGraphAnnotationsContext fetches graph annotations.

func (*Client) FindHost

func (c *Client) FindHost(hostID string) (*Host, error)

FindHost finds the host.

func (*Client) FindHostByCustomIdentifier added in v0.22.0

func (c *Client) FindHostByCustomIdentifier(customIdentifier string, param *FindHostByCustomIdentifierParam) (*Host, error)

FindHostByCustomIdentifier finds a host by the custom identifier.

func (*Client) FindHostByCustomIdentifierContext added in v0.40.0

func (c *Client) FindHostByCustomIdentifierContext(ctx context.Context, customIdentifier string, param *FindHostByCustomIdentifierParam) (*Host, error)

FindHostByCustomIdentifierContext finds a host by the custom identifier.

func (*Client) FindHostContext added in v0.40.0

func (c *Client) FindHostContext(ctx context.Context, hostID string) (*Host, error)

FindHostContext finds the host.

func (*Client) FindHosts

func (c *Client) FindHosts(param *FindHostsParam) ([]*Host, error)

FindHosts finds hosts.

func (*Client) FindHostsContext added in v0.40.0

func (c *Client) FindHostsContext(ctx context.Context, param *FindHostsParam) ([]*Host, error)

FindHostsContext finds hosts.

func (*Client) FindInvitations added in v0.9.0

func (c *Client) FindInvitations() ([]*Invitation, error)

FindInvitations finds invitations.

func (*Client) FindInvitationsContext added in v0.40.0

func (c *Client) FindInvitationsContext(ctx context.Context) ([]*Invitation, error)

FindInvitationsContext finds invitations.

func (*Client) FindMonitors

func (c *Client) FindMonitors() ([]Monitor, error)

FindMonitors finds monitors.

func (*Client) FindMonitorsContext added in v0.40.0

func (c *Client) FindMonitorsContext(ctx context.Context) ([]Monitor, error)

FindMonitorsContext finds monitors.

func (*Client) FindNotificationGroups added in v0.10.0

func (c *Client) FindNotificationGroups() ([]*NotificationGroup, error)

FindNotificationGroups finds notification groups.

func (*Client) FindNotificationGroupsContext added in v0.40.0

func (c *Client) FindNotificationGroupsContext(ctx context.Context) ([]*NotificationGroup, error)

FindNotificationGroupsContext finds notification groups.

func (*Client) FindRoles added in v0.2.0

func (c *Client) FindRoles(serviceName string) ([]*Role, error)

FindRoles finds roles.

func (*Client) FindRolesContext added in v0.40.0

func (c *Client) FindRolesContext(ctx context.Context, serviceName string) ([]*Role, error)

FindRolesContext finds roles.

func (*Client) FindServices

func (c *Client) FindServices() ([]*Service, error)

FindServices finds services.

func (*Client) FindServicesContext added in v0.40.0

func (c *Client) FindServicesContext(ctx context.Context) ([]*Service, error)

FindServicesContext finds services.

func (*Client) FindUsers added in v0.6.0

func (c *Client) FindUsers() ([]*User, error)

FindUsers finds users.

func (*Client) FindUsersContext added in v0.40.0

func (c *Client) FindUsersContext(ctx context.Context) ([]*User, error)

FindUsersContext finds users.

func (*Client) FindWithClosedAlerts added in v0.1.0

func (c *Client) FindWithClosedAlerts() (*AlertsResp, error)

FindWithClosedAlerts finds open and close alerts.

func (*Client) FindWithClosedAlertsByNextID added in v0.1.0

func (c *Client) FindWithClosedAlertsByNextID(nextID string) (*AlertsResp, error)

FindWithClosedAlertsByNextID finds open and close alerts by next id.

func (*Client) FindWithClosedAlertsByNextIDContext added in v0.40.0

func (c *Client) FindWithClosedAlertsByNextIDContext(ctx context.Context, nextID string) (*AlertsResp, error)

FindWithClosedAlertsByNextIDContext finds open and close alerts by next id.

func (*Client) FindWithClosedAlertsContext added in v0.40.0

func (c *Client) FindWithClosedAlertsContext(ctx context.Context) (*AlertsResp, error)

FindWithClosedAlertsContext finds open and close alerts.

func (*Client) GetAlert added in v0.21.0

func (c *Client) GetAlert(alertID string) (*Alert, error)

GetAlert gets an alert.

func (*Client) GetAlertContext added in v0.40.0

func (c *Client) GetAlertContext(ctx context.Context, alertID string) (*Alert, error)

GetAlertContext gets an alert.

func (*Client) GetAlertGroupSetting added in v0.11.0

func (c *Client) GetAlertGroupSetting(id string) (*AlertGroupSetting, error)

GetAlertGroupSetting gets an alert group setting.

func (*Client) GetAlertGroupSettingContext added in v0.40.0

func (c *Client) GetAlertGroupSettingContext(ctx context.Context, id string) (*AlertGroupSetting, error)

GetAlertGroupSettingContext gets an alert group setting.

func (*Client) GetHostMetaData

func (c *Client) GetHostMetaData(hostID, namespace string) (*HostMetaDataResp, error)

GetHostMetaData gets a host metadata.

func (*Client) GetHostMetaDataContext added in v0.40.0

func (c *Client) GetHostMetaDataContext(ctx context.Context, hostID, namespace string) (*HostMetaDataResp, error)

GetHostMetaDataContext gets a host metadata.

func (*Client) GetHostMetaDataNameSpaces

func (c *Client) GetHostMetaDataNameSpaces(hostID string) ([]string, error)

GetHostMetaDataNameSpaces fetches namespaces of host metadata.

func (*Client) GetHostMetaDataNameSpacesContext added in v0.40.0

func (c *Client) GetHostMetaDataNameSpacesContext(ctx context.Context, hostID string) ([]string, error)

GetHostMetaDataNameSpacesContext fetches namespaces of host metadata.

func (*Client) GetMonitor

func (c *Client) GetMonitor(monitorID string) (Monitor, error)

GetMonitor gets a monitor.

func (*Client) GetMonitorContext added in v0.40.0

func (c *Client) GetMonitorContext(ctx context.Context, monitorID string) (Monitor, error)

GetMonitorContext gets a monitor.

func (*Client) GetOrg

func (c *Client) GetOrg() (*Org, error)

GetOrg gets the org.

func (*Client) GetOrgContext added in v0.40.0

func (c *Client) GetOrgContext(ctx context.Context) (*Org, error)

GetOrgContext gets the org.

func (*Client) GetRoleMetaData

func (c *Client) GetRoleMetaData(serviceName, roleName, namespace string) (*RoleMetaDataResp, error)

GetRoleMetaData gets a role metadata.

func (*Client) GetRoleMetaDataContext added in v0.40.0

func (c *Client) GetRoleMetaDataContext(ctx context.Context, serviceName, roleName, namespace string) (*RoleMetaDataResp, error)

GetRoleMetaDataContext gets a role metadata.

func (*Client) GetRoleMetaDataNameSpaces

func (c *Client) GetRoleMetaDataNameSpaces(serviceName, roleName string) ([]string, error)

GetRoleMetaDataNameSpaces fetches namespaces of role metadata.

func (*Client) GetRoleMetaDataNameSpacesContext added in v0.40.0

func (c *Client) GetRoleMetaDataNameSpacesContext(ctx context.Context, serviceName, roleName string) ([]string, error)

GetRoleMetaDataNameSpacesContext fetches namespaces of role metadata.

func (*Client) GetServiceMetaData

func (c *Client) GetServiceMetaData(serviceName, namespace string) (*ServiceMetaDataResp, error)

GetServiceMetaData gets service metadata.

func (*Client) GetServiceMetaDataContext added in v0.40.0

func (c *Client) GetServiceMetaDataContext(ctx context.Context, serviceName, namespace string) (*ServiceMetaDataResp, error)

GetServiceMetaDataContext gets service metadata.

func (*Client) GetServiceMetaDataNameSpaces

func (c *Client) GetServiceMetaDataNameSpaces(serviceName string) ([]string, error)

GetServiceMetaDataNameSpaces fetches namespaces of service metadata.

func (*Client) GetServiceMetaDataNameSpacesContext added in v0.40.0

func (c *Client) GetServiceMetaDataNameSpacesContext(ctx context.Context, serviceName string) ([]string, error)

GetServiceMetaDataNameSpacesContext fetches namespaces of service metadata.

func (*Client) GetTrace added in v0.38.0

func (c *Client) GetTrace(traceID string) (*TraceResponse, error)

GetTrace gets detailed trace information for the specified trace ID

func (*Client) GetTraceContext added in v0.38.0

func (c *Client) GetTraceContext(ctx context.Context, traceID string) (*TraceResponse, error)

GetTraceContext is like [GetTrace].

func (*Client) ListAWSIntegrationExcludableMetrics added in v0.18.0

func (c *Client) ListAWSIntegrationExcludableMetrics() (*ListAWSIntegrationExcludableMetrics, error)

ListAWSIntegrationExcludableMetrics lists excludable metrics for AWS integration.

func (*Client) ListAWSIntegrationExcludableMetricsContext added in v0.40.0

func (c *Client) ListAWSIntegrationExcludableMetricsContext(ctx context.Context) (*ListAWSIntegrationExcludableMetrics, error)

ListAWSIntegrationExcludableMetricsContext lists excludable metrics for AWS integration.

func (*Client) ListDbQueryStats added in v0.38.0

func (c *Client) ListDbQueryStats(param *ListDbQueryStatsParam) (*DbQueryStatsPageConnection, error)

ListDbQueryStats retrieves database query statistics

func (*Client) ListDbQueryStatsContext added in v0.38.0

func (c *Client) ListDbQueryStatsContext(ctx context.Context, param *ListDbQueryStatsParam) (*DbQueryStatsPageConnection, error)

ListDbQueryStatsContext is like [ListDbQueryStats].

func (*Client) ListHTTPServerStats added in v0.38.0

func (c *Client) ListHTTPServerStats(param *ListHTTPServerStatsParam) (*HTTPServerStatsPageConnection, error)

ListHTTPServerStats retrieves HTTP server statistics

func (*Client) ListHTTPServerStatsContext added in v0.38.0

func (c *Client) ListHTTPServerStatsContext(ctx context.Context, param *ListHTTPServerStatsParam) (*HTTPServerStatsPageConnection, error)

ListHTTPServerStatsContext is like [ListHTTPServerStats].

func (*Client) ListHostMetricNames

func (c *Client) ListHostMetricNames(hostID string) ([]string, error)

ListHostMetricNames lists metric names of a host.

func (*Client) ListHostMetricNamesContext added in v0.40.0

func (c *Client) ListHostMetricNamesContext(ctx context.Context, hostID string) ([]string, error)

ListHostMetricNamesContext lists metric names of a host.

func (*Client) ListMonitoredStatues added in v0.13.0

func (c *Client) ListMonitoredStatues(hostID string) ([]MonitoredStatus, error)

ListMonitoredStatues lists monitored statues of a host.

func (*Client) ListMonitoredStatuesContext added in v0.40.0

func (c *Client) ListMonitoredStatuesContext(ctx context.Context, hostID string) ([]MonitoredStatus, error)

ListMonitoredStatuesContext lists monitored statues of a host.

func (*Client) ListServiceMetricNames

func (c *Client) ListServiceMetricNames(serviceName string) ([]string, error)

ListServiceMetricNames lists metric names of a service.

func (*Client) ListServiceMetricNamesContext added in v0.40.0

func (c *Client) ListServiceMetricNamesContext(ctx context.Context, serviceName string) ([]string, error)

ListServiceMetricNamesContext lists metric names of a service.

func (*Client) ListTraces added in v0.38.0

func (c *Client) ListTraces(params *ListTracesParam) (*ListTracesResponse, error)

ListTraces searches traces

func (*Client) ListTracesContext added in v0.38.0

func (c *Client) ListTracesContext(ctx context.Context, params *ListTracesParam) (*ListTracesResponse, error)

ListTracesContext is like [ListTraces].

func (*Client) ListTracesSeq added in v0.38.0

func (c *Client) ListTracesSeq(ctx context.Context, params *ListTracesParam) iter.Seq2[*ListTracesResult, error]

ListTracesSeq returns an iterator over traces that are selecting by params. When it reaches the end of the traces in a request, it automatically fetches subsequent pages from the API using the same params except [ListTracesParams.Page], then the iterator continues its results. Errors returned from the API are reported to the consumer via the second parameter of the iterator.

If an error occurs, the iterator will retry the request with the exact same params on subsequent calls until a successful response is received. Note that the iterator does not include a delay between retries. Therefore, the consumer should wait for sufficient period before each retry.

func (*Client) PostCheckReports

func (c *Client) PostCheckReports(checkReports *CheckReports) error

PostCheckReports reports check monitoring results.

func (*Client) PostCheckReportsContext added in v0.40.0

func (c *Client) PostCheckReportsContext(ctx context.Context, checkReports *CheckReports) error

PostCheckReportsContext reports check monitoring results.

func (*Client) PostHostMetricValues

func (c *Client) PostHostMetricValues(metricValues []*HostMetricValue) error

PostHostMetricValues post host metrics

func (*Client) PostHostMetricValuesByHostID

func (c *Client) PostHostMetricValuesByHostID(hostID string, metricValues []*MetricValue) error

PostHostMetricValuesByHostID post host metrics

func (*Client) PostHostMetricValuesByHostIDContext added in v0.40.0

func (c *Client) PostHostMetricValuesByHostIDContext(ctx context.Context, hostID string, metricValues []*MetricValue) error

PostHostMetricValuesByHostIDContext post host metrics

func (*Client) PostHostMetricValuesContext added in v0.40.0

func (c *Client) PostHostMetricValuesContext(ctx context.Context, metricValues []*HostMetricValue) error

PostHostMetricValuesContext post host metrics

func (*Client) PostJSON deprecated

func (c *Client) PostJSON(path string, payload any) (*http.Response, error)

Deprecated: use other prefered method.

func (*Client) PostJSONContext added in v0.40.0

func (c *Client) PostJSONContext(ctx context.Context, path string, payload any) (*http.Response, error)

PostJSONContext shortcut method for posting json

func (*Client) PostServiceMetricValues

func (c *Client) PostServiceMetricValues(serviceName string, metricValues []*MetricValue) error

PostServiceMetricValues posts service metrics.

func (*Client) PostServiceMetricValuesContext added in v0.40.0

func (c *Client) PostServiceMetricValuesContext(ctx context.Context, serviceName string, metricValues []*MetricValue) error

PostServiceMetricValuesContext posts service metrics.

func (*Client) PutHostMetaData

func (c *Client) PutHostMetaData(hostID, namespace string, metadata HostMetaData) error

PutHostMetaData puts a host metadata.

func (*Client) PutHostMetaDataContext added in v0.40.0

func (c *Client) PutHostMetaDataContext(ctx context.Context, hostID, namespace string, metadata HostMetaData) error

PutHostMetaDataContext puts a host metadata.

func (*Client) PutJSON deprecated

func (c *Client) PutJSON(path string, payload any) (*http.Response, error)

Deprecated: use other prefered method.

func (*Client) PutJSONContext added in v0.40.0

func (c *Client) PutJSONContext(ctx context.Context, path string, payload any) (*http.Response, error)

PutJSONContext shortcut method for putting json

func (*Client) PutRoleMetaData

func (c *Client) PutRoleMetaData(serviceName, roleName, namespace string, metadata RoleMetaData) error

PutRoleMetaData puts a role metadata.

func (*Client) PutRoleMetaDataContext added in v0.40.0

func (c *Client) PutRoleMetaDataContext(ctx context.Context, serviceName, roleName, namespace string, metadata RoleMetaData) error

PutRoleMetaDataContext puts a role metadata.

func (*Client) PutServiceMetaData

func (c *Client) PutServiceMetaData(serviceName, namespace string, metadata ServiceMetaData) error

PutServiceMetaData puts a service metadata.

func (*Client) PutServiceMetaDataContext added in v0.40.0

func (c *Client) PutServiceMetaDataContext(ctx context.Context, serviceName, namespace string, metadata ServiceMetaData) error

v puts a service metadata.

func (*Client) Request

func (c *Client) Request(req *http.Request) (resp *http.Response, err error)

Request request to mackerel and receive response

func (*Client) RetireHost

func (c *Client) RetireHost(hostID string) error

RetireHost retires the host.

func (*Client) RetireHostContext added in v0.40.0

func (c *Client) RetireHostContext(ctx context.Context, hostID string) error

RetireHostContext retires the host.

func (*Client) UpdateAWSIntegration added in v0.18.0

func (c *Client) UpdateAWSIntegration(awsIntegrationID string, param *UpdateAWSIntegrationParam) (*AWSIntegration, error)

UpdateAWSIntegration updates an AWS integration setting.

func (*Client) UpdateAWSIntegrationContext added in v0.40.0

func (c *Client) UpdateAWSIntegrationContext(ctx context.Context, awsIntegrationID string, param *UpdateAWSIntegrationParam) (*AWSIntegration, error)

UpdateAWSIntegrationContext updates an AWS integration setting.

func (*Client) UpdateAlert added in v0.23.0

func (c *Client) UpdateAlert(alertID string, param UpdateAlertParam) (*UpdateAlertResponse, error)

UpdateAlert updates an alert.

func (*Client) UpdateAlertContext added in v0.40.0

func (c *Client) UpdateAlertContext(ctx context.Context, alertID string, param UpdateAlertParam) (*UpdateAlertResponse, error)

UpdateAlertContext updates an alert.

func (*Client) UpdateAlertGroupSetting added in v0.11.0

func (c *Client) UpdateAlertGroupSetting(id string, param *AlertGroupSetting) (*AlertGroupSetting, error)

UpdateAlertGroupSetting updates an alert group setting.

func (*Client) UpdateAlertGroupSettingContext added in v0.40.0

func (c *Client) UpdateAlertGroupSettingContext(ctx context.Context, id string, param *AlertGroupSetting) (*AlertGroupSetting, error)

UpdateAlertGroupSettingContext updates an alert group setting.

func (*Client) UpdateChannel added in v0.38.0

func (c *Client) UpdateChannel(channelId string, param *Channel) (*Channel, error)

UpdateChannel updates a specific channel

func (*Client) UpdateChannelContext added in v0.38.0

func (c *Client) UpdateChannelContext(ctx context.Context, channelID string, param *Channel) (*Channel, error)

UpdateChannelContext is like [UpdateChannel]

func (*Client) UpdateDashboard

func (c *Client) UpdateDashboard(dashboardID string, param *Dashboard) (*Dashboard, error)

UpdateDashboard updates a dashboard.

func (*Client) UpdateDashboardContext added in v0.40.0

func (c *Client) UpdateDashboardContext(ctx context.Context, dashboardID string, param *Dashboard) (*Dashboard, error)

UpdateDashboardContext updates a dashboard.

func (*Client) UpdateDowntime added in v0.8.0

func (c *Client) UpdateDowntime(downtimeID string, param *Downtime) (*Downtime, error)

UpdateDowntime updates a downtime.

func (*Client) UpdateDowntimeContext added in v0.40.0

func (c *Client) UpdateDowntimeContext(ctx context.Context, downtimeID string, param *Downtime) (*Downtime, error)

UpdateDowntimeContext updates a downtime.

func (*Client) UpdateGraphAnnotation

func (c *Client) UpdateGraphAnnotation(annotationID string, annotation *GraphAnnotation) (*GraphAnnotation, error)

UpdateGraphAnnotation updates a graph annotation.

func (*Client) UpdateGraphAnnotationContext added in v0.40.0

func (c *Client) UpdateGraphAnnotationContext(ctx context.Context, annotationID string, annotation *GraphAnnotation) (*GraphAnnotation, error)

UpdateGraphAnnotationContext updates a graph annotation.

func (*Client) UpdateHost

func (c *Client) UpdateHost(hostID string, param *UpdateHostParam) (string, error)

UpdateHost updates a host.

func (*Client) UpdateHostContext added in v0.40.0

func (c *Client) UpdateHostContext(ctx context.Context, hostID string, param *UpdateHostParam) (string, error)

UpdateHostContext updates a host.

func (*Client) UpdateHostRoleFullnames

func (c *Client) UpdateHostRoleFullnames(hostID string, roleFullnames []string) error

UpdateHostRoleFullnames updates host roles.

func (*Client) UpdateHostRoleFullnamesContext added in v0.40.0

func (c *Client) UpdateHostRoleFullnamesContext(ctx context.Context, hostID string, roleFullnames []string) error

UpdateHostRoleFullnamesContext updates host roles.

func (*Client) UpdateHostStatus

func (c *Client) UpdateHostStatus(hostID string, status string) error

UpdateHostStatus updates a host status.

func (*Client) UpdateHostStatusContext added in v0.40.0

func (c *Client) UpdateHostStatusContext(ctx context.Context, hostID string, status string) error

UpdateHostStatusContext updates a host status.

func (*Client) UpdateMonitor

func (c *Client) UpdateMonitor(monitorID string, param Monitor) (Monitor, error)

UpdateMonitor updates a monitor.

func (*Client) UpdateMonitorContext added in v0.40.0

func (c *Client) UpdateMonitorContext(ctx context.Context, monitorID string, param Monitor) (Monitor, error)

UpdateMonitorContext updates a monitor.

func (*Client) UpdateNotificationGroup added in v0.10.0

func (c *Client) UpdateNotificationGroup(id string, param *NotificationGroup) (*NotificationGroup, error)

UpdateNotificationGroup updates a notification group.

func (*Client) UpdateNotificationGroupContext added in v0.40.0

func (c *Client) UpdateNotificationGroupContext(ctx context.Context, id string, param *NotificationGroup) (*NotificationGroup, error)

UpdateNotificationGroupContext updates a notification group.

type Cloud

type Cloud struct {
	Provider string `json:"provider,omitempty"`
	MetaData any    `json:"metadata,omitempty"`
}

Cloud cloud

type CreateAWSIntegrationParam added in v0.18.0

type CreateAWSIntegrationParam struct {
	Name         string                            `json:"name"`
	Memo         string                            `json:"memo"`
	Key          string                            `json:"key,omitempty"`
	SecretKey    string                            `json:"secretKey,omitempty"`
	RoleArn      string                            `json:"roleArn,omitempty"`
	ExternalID   string                            `json:"externalId,omitempty"`
	Region       string                            `json:"region"`
	IncludedTags string                            `json:"includedTags"`
	ExcludedTags string                            `json:"excludedTags"`
	Services     map[string]*AWSIntegrationService `json:"services"`
}

CreateAWSIntegrationParam parameters for CreateAWSIntegration

type CreateHostParam

type CreateHostParam struct {
	Name             string        `json:"name"`
	DisplayName      string        `json:"displayName,omitempty"`
	Memo             string        `json:"memo,omitempty"`
	Meta             HostMeta      `json:"meta"`
	Interfaces       []Interface   `json:"interfaces"`
	RoleFullnames    []string      `json:"roleFullnames"`
	Checks           []CheckConfig `json:"checks"`
	CustomIdentifier string        `json:"customIdentifier,omitempty"`
}

CreateHostParam parameters for CreateHost

type CreateRoleParam

type CreateRoleParam Role

CreateRoleParam parameters for CreateRole

type CreateServiceParam

type CreateServiceParam struct {
	Name string `json:"name"`
	Memo string `json:"memo"`
}

CreateServiceParam parameters for CreateService

type Dashboard

type Dashboard struct {
	ID        string   `json:"id,omitempty"`
	Title     string   `json:"title"`
	URLPath   string   `json:"urlPath"`
	CreatedAt int64    `json:"createdAt,omitempty"`
	UpdatedAt int64    `json:"updatedAt,omitempty"`
	Memo      string   `json:"memo"`
	Widgets   []Widget `json:"widgets"`
}

Dashboard information

type DbQueryStats added in v0.38.0

type DbQueryStats struct {
	Query           string  `json:"query"`
	ExecutionCount  int64   `json:"executionCount"`
	TotalMillis     float64 `json:"totalMillis"`
	AverageMillis   float64 `json:"averageMillis"`
	ApproxP95Millis float64 `json:"approxP95Millis"`
}

DbQueryStats represents database query statistics

type DbQueryStatsPageConnection added in v0.38.0

type DbQueryStatsPageConnection struct {
	Results     []*DbQueryStats `json:"results"`
	HasNextPage bool            `json:"hasNextPage"`
}

DbQueryStatsPageConnection represents a paginated response of database query statistics

type Downtime added in v0.8.0

type Downtime struct {
	ID                   string              `json:"id,omitempty"`
	Name                 string              `json:"name"`
	Memo                 string              `json:"memo,omitempty"`
	Start                int64               `json:"start"`
	Duration             int64               `json:"duration"`
	Recurrence           *DowntimeRecurrence `json:"recurrence,omitempty"`
	ServiceScopes        []string            `json:"serviceScopes,omitempty"`
	ServiceExcludeScopes []string            `json:"serviceExcludeScopes,omitempty"`
	RoleScopes           []string            `json:"roleScopes,omitempty"`
	RoleExcludeScopes    []string            `json:"roleExcludeScopes,omitempty"`
	MonitorScopes        []string            `json:"monitorScopes,omitempty"`
	MonitorExcludeScopes []string            `json:"monitorExcludeScopes,omitempty"`
}

Downtime information

type DowntimeRecurrence added in v0.8.0

type DowntimeRecurrence struct {
	Type     DowntimeRecurrenceType `json:"type"`
	Interval int64                  `json:"interval"`
	Weekdays []DowntimeWeekday      `json:"weekdays,omitempty"`
	Until    int64                  `json:"until,omitempty"`
}

DowntimeRecurrence ...

type DowntimeRecurrenceType added in v0.8.0

type DowntimeRecurrenceType int

DowntimeRecurrenceType ...

const (
	DowntimeRecurrenceTypeHourly DowntimeRecurrenceType = iota + 1
	DowntimeRecurrenceTypeDaily
	DowntimeRecurrenceTypeWeekly
	DowntimeRecurrenceTypeMonthly
	DowntimeRecurrenceTypeYearly
)

DowntimeRecurrenceType ...

func (DowntimeRecurrenceType) MarshalJSON added in v0.8.0

func (t DowntimeRecurrenceType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (DowntimeRecurrenceType) String added in v0.8.0

func (t DowntimeRecurrenceType) String() string

String implements Stringer

func (*DowntimeRecurrenceType) UnmarshalJSON added in v0.8.0

func (t *DowntimeRecurrenceType) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type DowntimeWeekday added in v0.8.0

type DowntimeWeekday time.Weekday

DowntimeWeekday ...

func (DowntimeWeekday) MarshalJSON added in v0.8.0

func (w DowntimeWeekday) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (DowntimeWeekday) String added in v0.8.0

func (w DowntimeWeekday) String() string

String implements Stringer

func (*DowntimeWeekday) UnmarshalJSON added in v0.8.0

func (w *DowntimeWeekday) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Event added in v0.38.0

type Event struct {
	Time                   time.Time    `json:"time"`
	Name                   string       `json:"name"`
	Attributes             []*Attribute `json:"attributes"`
	DroppedAttributesCount int          `json:"droppedAttributesCount"`
}

Event represents a span event

type FileSystem

type FileSystem map[string]any

FileSystem filesystem

type FindAlertLogsParam added in v0.37.0

type FindAlertLogsParam struct {
	NextId *string
	Limit  *int
}

FindAlertLogsParam is the parameters for FindAlertLogs

type FindAlertLogsResp added in v0.37.0

type FindAlertLogsResp struct {
	AlertLogs []*AlertLog `json:"logs"`
	NextID    string      `json:"nextId,omitempty"`
}

FindAlertLogsResp is for FindAlertLogs

type FindHostByCustomIdentifierParam added in v0.22.0

type FindHostByCustomIdentifierParam struct {
	CaseInsensitive bool
}

FindHostByCustomIdentifierParam parameters for FindHostByCustomIdentifier

type FindHostsParam

type FindHostsParam struct {
	Service          string
	Roles            []string
	Name             string
	Statuses         []string
	CustomIdentifier string
}

FindHostsParam parameters for FindHosts

type FormatRule added in v0.26.0

type FormatRule struct {
	Name      string  `json:"name"`
	Threshold float64 `json:"threshold"`
	Operator  string  `json:"operator"`
}

FormatRule information

type Graph added in v0.6.0

type Graph struct {
	Type         string `json:"type"`
	Name         string `json:"name,omitempty"`
	HostID       string `json:"hostId,omitempty"`
	RoleFullName string `json:"roleFullname,omitempty"`
	IsStacked    bool   `json:"isStacked,omitempty"`
	ServiceName  string `json:"serviceName,omitempty"`
	Expression   string `json:"expression,omitempty"`
	Query        string `json:"query,omitempty"`
	Legend       string `json:"legend,omitempty"`
}

Graph information

func (Graph) MarshalJSON added in v0.14.0

func (g Graph) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON

type GraphAnnotation

type GraphAnnotation struct {
	ID          string   `json:"id,omitempty"`
	Title       string   `json:"title,omitempty"`
	Description string   `json:"description,omitempty"`
	From        int64    `json:"from,omitempty"`
	To          int64    `json:"to,omitempty"`
	Service     string   `json:"service,omitempty"`
	Roles       []string `json:"roles,omitempty"`
}

GraphAnnotation represents parameters to post a graph annotation.

type GraphDefsMetric

type GraphDefsMetric struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
	IsStacked   bool   `json:"isStacked"`
}

GraphDefsMetric graph metric

type GraphDefsParam

type GraphDefsParam struct {
	Name        string             `json:"name"`
	DisplayName string             `json:"displayName,omitempty"`
	Unit        string             `json:"unit,omitempty"`
	Metrics     []*GraphDefsMetric `json:"metrics"`
}

GraphDefsParam parameters for posting graph definitions

type HTTPServerStats added in v0.38.0

type HTTPServerStats struct {
	Method              string  `json:"method"`
	Route               string  `json:"route"`
	TotalMillis         float64 `json:"totalMillis"`
	AverageMillis       float64 `json:"averageMillis"`
	ApproxP95Millis     float64 `json:"approxP95Millis"`
	ErrorRatePercentage float64 `json:"errorRatePercentage"`
	RequestCount        int64   `json:"requestCount"`
}

HTTPServerStats represents HTTP server statistics

type HTTPServerStatsPageConnection added in v0.38.0

type HTTPServerStatsPageConnection struct {
	Results     []*HTTPServerStats `json:"results"`
	HasNextPage bool               `json:"hasNextPage"`
}

HTTPServerStatsPageConnection represents a paginated response of HTTP server statistics

type HeaderField

type HeaderField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

HeaderField represents key-value pairs in an HTTP header for external http monitoring.

type Host

type Host struct {
	ID               string      `json:"id"`
	Name             string      `json:"name"`
	DisplayName      string      `json:"displayName,omitempty"`
	CustomIdentifier string      `json:"customIdentifier,omitempty"`
	Size             string      `json:"size"`
	Status           string      `json:"status"`
	Memo             string      `json:"memo"`
	Roles            Roles       `json:"roles"`
	IsRetired        bool        `json:"isRetired"`
	CreatedAt        int32       `json:"createdAt"`
	Meta             HostMeta    `json:"meta"`
	Interfaces       []Interface `json:"interfaces"`
}

Host host information

func (*Host) DateFromCreatedAt

func (h *Host) DateFromCreatedAt() time.Time

DateFromCreatedAt returns time.Time

func (*Host) GetRoleFullnames

func (h *Host) GetRoleFullnames() []string

GetRoleFullnames gets role-full-names

func (*Host) IPAddresses

func (h *Host) IPAddresses() map[string]string

IPAddresses returns ipaddresses

type HostMeta

type HostMeta struct {
	AgentRevision string      `json:"agent-revision,omitempty"`
	AgentVersion  string      `json:"agent-version,omitempty"`
	AgentName     string      `json:"agent-name,omitempty"`
	BlockDevice   BlockDevice `json:"block_device,omitempty"`
	CPU           CPU         `json:"cpu,omitempty"`
	Filesystem    FileSystem  `json:"filesystem,omitempty"`
	Kernel        Kernel      `json:"kernel,omitempty"`
	Memory        Memory      `json:"memory,omitempty"`
	Cloud         *Cloud      `json:"cloud,omitempty"`
}

HostMeta host meta informations

type HostMetaData

type HostMetaData any

HostMetaData represents host metadata body.

type HostMetaDataResp

type HostMetaDataResp struct {
	HostMetaData HostMetaData
	LastModified time.Time
}

HostMetaDataResp represents response for host metadata.

type HostMetricValue

type HostMetricValue struct {
	HostID string `json:"hostId,omitempty"`
	*MetricValue
}

HostMetricValue host metric value

type Interface

type Interface struct {
	Name          string   `json:"name,omitempty"`
	IPAddress     string   `json:"ipAddress,omitempty"`
	IPv4Addresses []string `json:"ipv4Addresses,omitempty"`
	IPv6Addresses []string `json:"ipv6Addresses,omitempty"`
	MacAddress    string   `json:"macAddress,omitempty"`
}

Interface network interface

type Invitation added in v0.9.0

type Invitation struct {
	Email     string `json:"email,omitempty"`
	Authority string `json:"authority,omitempty"`
	ExpiresAt int64  `json:"expiresAt,omitempty"`
}

Invitation information

type Kernel

type Kernel map[string]string

Kernel kernel

type LatestMetricValues

type LatestMetricValues map[string]map[string]*MetricValue

LatestMetricValues latest metric value

type Layout added in v0.6.0

type Layout struct {
	X      int64 `json:"x"`
	Y      int64 `json:"y"`
	Width  int64 `json:"width"`
	Height int64 `json:"height"`
}

Layout information

type Link struct {
	TraceID                string       `json:"traceId"`
	SpanID                 string       `json:"spanId"`
	TraceState             string       `json:"traceState"`
	Attributes             []*Attribute `json:"attributes"`
	DroppedAttributesCount int          `json:"droppedAttributesCount"`
}

Link represents a link to another span

type ListAWSIntegrationExcludableMetrics added in v0.18.0

type ListAWSIntegrationExcludableMetrics map[string][]string

ListAWSIntegrationExcludableMetrics List of excludeable metric names for AWS integration

type ListDbQueryStatsParam added in v0.38.0

type ListDbQueryStatsParam struct {
	ServiceName      string
	From             int64
	To               int64
	ServiceNamespace *string
	Environment      *string
	Version          *string
	Query            *string
	OrderColumn      *string
	OrderDirection   *string
	Page             *int
	PerPage          *int
}

ListDbQueryStatsParam represents parameters for listing database query statistics

type ListHTTPServerStatsParam added in v0.38.0

type ListHTTPServerStatsParam struct {
	ServiceName      string
	From             int64
	To               int64
	ServiceNamespace *string
	Environment      *string
	Version          *string
	OrderColumn      *string
	OrderDirection   *string
	Method           *string
	Route            *string
	Page             *int
	PerPage          *int
}

ListHTTPServerStatsParam represents parameters for listing HTTP server statistics

type ListTracesParam added in v0.38.0

type ListTracesParam struct {
	ServiceName        string                     `json:"serviceName"`
	ServiceNamespace   *string                    `json:"serviceNamespace,omitzero"`
	From               int64                      `json:"from"`
	To                 int64                      `json:"to"`
	Environment        *string                    `json:"environment,omitzero"`
	TraceID            *string                    `json:"traceId,omitzero"`
	SpanName           *string                    `json:"spanName,omitzero"`
	Version            *string                    `json:"version,omitzero"`
	IssueFingerprint   *string                    `json:"issueFingerprint,omitzero"`
	StatusCode         *ListTracesParamStatusCode `json:"statusCode,omitzero"`
	MinLatencyMillis   *int64                     `json:"minLatencyMillis,omitzero"`
	MaxLatencyMillis   *int64                     `json:"maxLatencyMillis,omitzero"`
	Attributes         []TraceAttributeFilter     `json:"attributes,omitzero"`
	ResourceAttributes []TraceAttributeFilter     `json:"resourceAttributes,omitzero"`
	Page               *int                       `json:"page,omitzero"`
	PerPage            *int                       `json:"perPage,omitzero"`
	Order              TraceOrder                 `json:"order,omitzero"`
}

type ListTracesParamStatusCode added in v0.39.0

type ListTracesParamStatusCode string
const (
	ListTracesParamStatusCodeOk    ListTracesParamStatusCode = "OK"
	ListTracesParamStatusCodeError ListTracesParamStatusCode = "ERROR"
)

type ListTracesResponse added in v0.38.0

type ListTracesResponse struct {
	Results     []*ListTracesResult `json:"results"`
	HasNextPage bool                `json:"hasNextPage"`
}

type ListTracesResult added in v0.38.0

type ListTracesResult struct {
	TraceID              string `json:"traceId"`
	ServiceName          string `json:"serviceName"`
	ServiceNamespace     string `json:"serviceNamespace"`
	Environment          string `json:"environment"`
	Title                string `json:"title"`
	TraceStartAt         int64  `json:"traceStartAt"`
	TraceLatencyMillis   int64  `json:"traceLatencyMillis"`
	ServiceStartAt       int64  `json:"serviceStartAt"`
	ServiceLatencyMillis int64  `json:"serviceLatencyMillis"`
}

type Memory

type Memory map[string]string

Memory memory

type Mentions added in v0.9.0

type Mentions struct {
	OK       string `json:"ok,omitempty"`
	Warning  string `json:"warning,omitempty"`
	Critical string `json:"critical,omitempty"`
}

Mentions represents the structure used for slack channel mentions

type Metric added in v0.6.0

type Metric struct {
	Type        string `json:"type"`
	Name        string `json:"name,omitempty"`
	HostID      string `json:"hostId,omitempty"`
	ServiceName string `json:"serviceName,omitempty"`
	Expression  string `json:"expression,omitempty"`
	Query       string `json:"query,omitempty"`
	Legend      string `json:"legend,omitempty"`
}

Metric information

func (Metric) MarshalJSON added in v0.14.0

func (m Metric) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON

type MetricValue

type MetricValue struct {
	Name  string `json:"name,omitempty"`
	Time  int64  `json:"time,omitempty"`
	Value any    `json:"value,omitempty"`
}

MetricValue metric value

type Monitor

type Monitor interface {
	MonitorType() string
	MonitorID() string
	MonitorName() string
	// contains filtered or unexported methods
}
{
  "monitors": [
    {
      "id": "2cSZzK3XfmG",
      "type": "connectivity",
      "isMute": false,
      "scopes": [],
      "excludeScopes": [],
      "alertStatusOnGone": "WARNING"
    },
    {
      "id"  : "2cSZzK3XfmG",
      "type": "host",
      "isMute": false,
      "name": "disk.aa-00.writes.delta",
      "duration": 3,
      "metric": "disk.aa-00.writes.delta",
      "operator": ">",
      "warning": 20000.0,
      "critical": 400000.0,
      "scopes": [
        "SomeService"
      ],
      "excludeScopes": [
        "SomeService: db-slave-backup"
      ],
      "maxCheckAttempts": 1,
      "notificationInterval": 60
    },
    {
      "id"  : "2cSZzK3XfmG",
      "type": "service",
      "isMute": false,
      "name": "SomeService - custom.access_num.4xx_count",
      "service": "SomeService",
      "duration": 1,
      "metric": "custom.access_num.4xx_count",
      "operator": ">",
      "warning": 50.0,
      "critical": 100.0,
      "maxCheckAttempts": 1,
      "missingDurationWarning": 360,
      "missingDurationCritical": 720
    },
    {
      "id"  : "2cSZzK3XfmG",
      "type": "external",
      "isMute": false,
      "name": "example.com",
      "method": "GET",
      "url": "http://www.example.com",
      "service": "SomeService",
      "maxCheckAttempts": 1,
      "responseTimeCritical": 10000,
      "responseTimeWarning": 5000,
      "responseTimeDuration": 5,
      "certificationExpirationCritical": 15,
      "certificationExpirationWarning": 30,
      "expectedStatusCode": 200,
      "requestBody": "Request Body",
      "containsString": "Example",
      "skipCertificateVerification": true,
      "followRedirect": true,
      "headers": [
        { "name": "Cache-Control", "value": "no-cache"}
      ]
    },
    {
      "id": "3CSsK3HKiHb",
      "type": "anomalyDetection",
      "isMute": false,
      "name": "My first anomaly detection",
      "trainingPeriodFrom": 1561429260,
      "scopes": [
        "MyService: MyRole"
      ],
      "maxCheckAttempts": 3,
      "warningSensitivity": "insensitive"
    },
    {
      "id": "57We5nNtpZA",
      "type": "query",
      "isMute": false,
      "name": "LabeldMetric - custom.access_counter",
      "query": "custom.access_counter",
      "operator": ">",
      "warning": 30.0,
      "critical": 300.0,
      "legend":""
    }
  ]
}

Monitor represents interface to which each monitor type must confirm to.

type MonitorAnomalyDetection added in v0.6.0

type MonitorAnomalyDetection struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	WarningSensitivity  string `json:"warningSensitivity,omitempty"`
	CriticalSensitivity string `json:"criticalSensitivity,omitempty"`
	TrainingPeriodFrom  uint64 `json:"trainingPeriodFrom,omitempty"`
	MaxCheckAttempts    uint64 `json:"maxCheckAttempts,omitempty"`

	Scopes []string `json:"scopes"`
}

MonitorAnomalyDetection represents anomaly detection monitor.

func (*MonitorAnomalyDetection) MonitorID added in v0.6.0

func (m *MonitorAnomalyDetection) MonitorID() string

MonitorID returns monitor id.

func (*MonitorAnomalyDetection) MonitorName added in v0.6.0

func (m *MonitorAnomalyDetection) MonitorName() string

MonitorName returns monitor name.

func (*MonitorAnomalyDetection) MonitorType added in v0.6.0

func (m *MonitorAnomalyDetection) MonitorType() string

MonitorType returns monitor type.

type MonitorConnectivity

type MonitorConnectivity struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	AlertStatusOnGone    string `json:"alertStatusOnGone,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Scopes        []string `json:"scopes,omitempty"`
	ExcludeScopes []string `json:"excludeScopes,omitempty"`
}

MonitorConnectivity represents connectivity monitor.

func (*MonitorConnectivity) MonitorID

func (m *MonitorConnectivity) MonitorID() string

MonitorID returns monitor id.

func (*MonitorConnectivity) MonitorName

func (m *MonitorConnectivity) MonitorName() string

MonitorName returns monitor name.

func (*MonitorConnectivity) MonitorType

func (m *MonitorConnectivity) MonitorType() string

MonitorType returns monitor type.

type MonitorExpression

type MonitorExpression struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Expression              string   `json:"expression,omitempty"`
	Operator                string   `json:"operator,omitempty"`
	Warning                 *float64 `json:"warning"`
	Critical                *float64 `json:"critical"`
	EvaluateBackwardMinutes *uint64  `json:"evaluateBackwardMinutes,omitempty"`
}

MonitorExpression represents expression monitor.

func (*MonitorExpression) MonitorID

func (m *MonitorExpression) MonitorID() string

MonitorID returns monitor id.

func (*MonitorExpression) MonitorName

func (m *MonitorExpression) MonitorName() string

MonitorName returns monitor name.

func (*MonitorExpression) MonitorType

func (m *MonitorExpression) MonitorType() string

MonitorType returns monitor type.

type MonitorExternalHTTP

type MonitorExternalHTTP struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Method                          string   `json:"method,omitempty"`
	URL                             string   `json:"url,omitempty"`
	MaxCheckAttempts                uint64   `json:"maxCheckAttempts,omitempty"`
	Service                         string   `json:"service,omitempty"`
	ResponseTimeCritical            *float64 `json:"responseTimeCritical,omitempty"`
	ResponseTimeWarning             *float64 `json:"responseTimeWarning,omitempty"`
	ResponseTimeDuration            *uint64  `json:"responseTimeDuration,omitempty"`
	RequestBody                     string   `json:"requestBody,omitempty"`
	ContainsString                  string   `json:"containsString,omitempty"`
	CertificationExpirationCritical *uint64  `json:"certificationExpirationCritical,omitempty"`
	CertificationExpirationWarning  *uint64  `json:"certificationExpirationWarning,omitempty"`
	SkipCertificateVerification     bool     `json:"skipCertificateVerification,omitempty"`
	FollowRedirect                  bool     `json:"followRedirect,omitempty"`
	ExpectedStatusCode              *int     `json:"expectedStatusCode,omitempty"`
	// Empty list of headers and nil are different. You have to specify empty
	// list as headers explicitly if you want to remove all headers instead of
	// using nil.
	Headers []HeaderField `json:"headers"`
}

MonitorExternalHTTP represents external HTTP monitor.

func (*MonitorExternalHTTP) MonitorID

func (m *MonitorExternalHTTP) MonitorID() string

MonitorID returns monitor id.

func (*MonitorExternalHTTP) MonitorName

func (m *MonitorExternalHTTP) MonitorName() string

MonitorName returns monitor name.

func (*MonitorExternalHTTP) MonitorType

func (m *MonitorExternalHTTP) MonitorType() string

MonitorType returns monitor type.

type MonitorHostMetric

type MonitorHostMetric struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Metric           string   `json:"metric,omitempty"`
	Operator         string   `json:"operator,omitempty"`
	Warning          *float64 `json:"warning"`
	Critical         *float64 `json:"critical"`
	Duration         uint64   `json:"duration,omitempty"`
	MaxCheckAttempts uint64   `json:"maxCheckAttempts,omitempty"`

	Scopes        []string `json:"scopes,omitempty"`
	ExcludeScopes []string `json:"excludeScopes,omitempty"`
}

MonitorHostMetric represents host metric monitor.

func (*MonitorHostMetric) MonitorID

func (m *MonitorHostMetric) MonitorID() string

MonitorID returns monitor id.

func (*MonitorHostMetric) MonitorName

func (m *MonitorHostMetric) MonitorName() string

MonitorName returns monitor name.

func (*MonitorHostMetric) MonitorType

func (m *MonitorHostMetric) MonitorType() string

MonitorType returns monitor type.

type MonitorQuery added in v0.31.0

type MonitorQuery struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Query                   string   `json:"query,omitempty"`
	Operator                string   `json:"operator,omitempty"`
	Warning                 *float64 `json:"warning"`
	Critical                *float64 `json:"critical"`
	Legend                  string   `json:"legend,omitempty"`
	EvaluateBackwardMinutes *uint64  `json:"evaluateBackwardMinutes,omitempty"`
}

MonitorQuery represents query monitor.

func (*MonitorQuery) MonitorID added in v0.31.0

func (m *MonitorQuery) MonitorID() string

MonitorID returns monitor id.

func (*MonitorQuery) MonitorName added in v0.31.0

func (m *MonitorQuery) MonitorName() string

MonitorName returns monitor name.

func (*MonitorQuery) MonitorType added in v0.31.0

func (m *MonitorQuery) MonitorType() string

MonitorType returns monitor type.

type MonitorServiceMetric

type MonitorServiceMetric struct {
	ID                   string `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	Memo                 string `json:"memo,omitempty"`
	Type                 string `json:"type,omitempty"`
	IsMute               bool   `json:"isMute,omitempty"`
	NotificationInterval uint64 `json:"notificationInterval,omitempty"`

	Service                 string   `json:"service,omitempty"`
	Metric                  string   `json:"metric,omitempty"`
	Operator                string   `json:"operator,omitempty"`
	Warning                 *float64 `json:"warning"`
	Critical                *float64 `json:"critical"`
	Duration                uint64   `json:"duration,omitempty"`
	MaxCheckAttempts        uint64   `json:"maxCheckAttempts,omitempty"`
	MissingDurationWarning  uint64   `json:"missingDurationWarning,omitempty"`
	MissingDurationCritical uint64   `json:"missingDurationCritical,omitempty"`
}

MonitorServiceMetric represents service metric monitor.

func (*MonitorServiceMetric) MonitorID

func (m *MonitorServiceMetric) MonitorID() string

MonitorID returns monitor id.

func (*MonitorServiceMetric) MonitorName

func (m *MonitorServiceMetric) MonitorName() string

MonitorName returns monitor name.

func (*MonitorServiceMetric) MonitorType

func (m *MonitorServiceMetric) MonitorType() string

MonitorType returns monitor type.

type MonitoredStatus added in v0.13.0

type MonitoredStatus struct {
	MonitorID string                `json:"monitorId"`
	Status    string                `json:"status"`
	Detail    MonitoredStatusDetail `json:"detail,omitempty"`
}

MonitoredStatus monitored status

type MonitoredStatusDetail added in v0.13.0

type MonitoredStatusDetail struct {
	Type    string `json:"type"`
	Message string `json:"message,omitempty"`
	Memo    string `json:"memo,omitempty"`
}

MonitoredStatusDetail monitored status detail

type NotificationGroup added in v0.10.0

type NotificationGroup struct {
	// ID is excluded when used to call CreateNotificationGroup.
	ID string `json:"id,omitempty"`

	// Type is excluded when used to call CreateNotificationGroup or UpdateNotificationGroup.
	Type                      NotificationGroupType       `json:"type,omitempty"`
	Name                      string                      `json:"name"`
	NotificationLevel         NotificationLevel           `json:"notificationLevel"`
	ChildNotificationGroupIDs []string                    `json:"childNotificationGroupIds"`
	ChildChannelIDs           []string                    `json:"childChannelIds"`
	Monitors                  []*NotificationGroupMonitor `json:"monitors,omitempty"`
	Services                  []*NotificationGroupService `json:"services,omitempty"`
}

NotificationGroup represents a Mackerel notification group. ref. https://mackerel.io/api-docs/entry/notification-groups

type NotificationGroupMonitor added in v0.10.0

type NotificationGroupMonitor struct {
	ID          string `json:"id"`
	SkipDefault bool   `json:"skipDefault"`
}

NotificationGroupMonitor represents a notification target monitor rule.

type NotificationGroupService added in v0.10.0

type NotificationGroupService struct {
	Name string `json:"name"`
}

NotificationGroupService represents a notification target service.

type NotificationGroupType added in v0.43.0

type NotificationGroupType string

NotificationGroupType represents a type of notification group.

const (
	NotificationGroupTypeGroup        NotificationGroupType = "group"
	NotificationGroupTypeGroupDefault NotificationGroupType = "group-default"
)

NotificationGroupTypes

type NotificationLevel added in v0.10.0

type NotificationLevel string

NotificationLevel represents a level of notification.

const (
	NotificationLevelAll      NotificationLevel = "all"
	NotificationLevelCritical NotificationLevel = "critical"
)

NotificationLevels

type OrderDirection added in v0.38.0

type OrderDirection string
const (
	OrderDirectionASC  OrderDirection = "ASC"
	OrderDirectionDESC OrderDirection = "DESC"
)

type Org

type Org struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName,omitempty"`
}

Org information

type PrioritizedLogger added in v0.5.0

type PrioritizedLogger interface {
	Tracef(format string, v ...any)
	Debugf(format string, v ...any)
	Infof(format string, v ...any)
	Warningf(format string, v ...any)
	Errorf(format string, v ...any)
}

PrioritizedLogger is the interface that groups prioritized logging methods.

type Range added in v0.6.0

type Range struct {
	Type   string `json:"type"`
	Period int64  `json:"period,omitempty"`
	Offset int64  `json:"offset,omitempty"`
	Start  int64  `json:"start,omitempty"`
	End    int64  `json:"end,omitempty"`
}

Range information

func (Range) MarshalJSON added in v0.14.0

func (r Range) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON

type ReferenceLine added in v0.26.0

type ReferenceLine struct {
	Label string  `json:"label"`
	Value float64 `json:"value"`
}

ReferenceLine information

type Resource added in v0.38.0

type Resource struct {
	Attributes             []*Attribute `json:"attributes"`
	DroppedAttributesCount int          `json:"droppedAttributesCount"`
}

Resource represents resource information

type Role

type Role struct {
	Name string `json:"name"`
	Memo string `json:"memo"`
}

Role represents Mackerel "role".

type RoleMetaData

type RoleMetaData any

RoleMetaData represents role metadata body.

type RoleMetaDataResp

type RoleMetaDataResp struct {
	RoleMetaData RoleMetaData
	LastModified time.Time
}

RoleMetaDataResp represents response for role metadata.

type Roles

type Roles map[string][]string

Roles host role maps

type Scope added in v0.38.0

type Scope struct {
	Name                   string       `json:"name"`
	Version                string       `json:"version"`
	Attributes             []*Attribute `json:"attributes"`
	DroppedAttributesCount int          `json:"droppedAttributesCount"`
}

Scope represents scope information

type Service

type Service struct {
	Name  string   `json:"name"`
	Memo  string   `json:"memo"`
	Roles []string `json:"roles"`
}

Service represents Mackerel "service".

type ServiceMetaData

type ServiceMetaData any

ServiceMetaData represents service metadata body.

type ServiceMetaDataResp

type ServiceMetaDataResp struct {
	ServiceMetaData ServiceMetaData
	LastModified    time.Time
}

ServiceMetaDataResp represents response for service metadata.

type Span added in v0.38.0

type Span struct {
	TraceID                string       `json:"traceId"`
	SpanID                 string       `json:"spanId"`
	TraceState             string       `json:"traceState"`
	ParentSpanID           string       `json:"parentSpanId,omitempty"`
	Name                   string       `json:"name"`
	Kind                   SpanKind     `json:"kind"`
	StartTime              time.Time    `json:"startTime"`
	EndTime                time.Time    `json:"endTime"`
	Attributes             []*Attribute `json:"attributes"`
	DroppedAttributesCount int          `json:"droppedAttributesCount"`
	Events                 []*Event     `json:"events"`
	DroppedEventsCount     int          `json:"droppedEventsCount"`
	Links                  []*Link      `json:"links"`
	DroppedLinksCount      int          `json:"droppedLinksCount"`
	Status                 *Status      `json:"status"`
	Resource               *Resource    `json:"resource"`
	Scope                  *Scope       `json:"scope"`
}

Span represents a single span in a trace

type SpanKind added in v0.38.0

type SpanKind string

SpanKind represents the kind of span

const (
	SpanKindUnspecified SpanKind = "unspecified"
	SpanKindInternal    SpanKind = "internal"
	SpanKindServer      SpanKind = "server"
	SpanKindClient      SpanKind = "client"
	SpanKindProducer    SpanKind = "producer"
	SpanKindConsumer    SpanKind = "consumer"
)

Span kind constants

type Status added in v0.38.0

type Status struct {
	Message string     `json:"message"`
	Code    StatusCode `json:"code"`
}

Status represents the execution state of a span

type StatusCode added in v0.38.0

type StatusCode string

StatusCode represents the status code of a span

const (
	StatusCodeUnset StatusCode = "unset"
	StatusCodeOK    StatusCode = "ok"
	StatusCodeError StatusCode = "error"
)

Status code constants

type TraceAttributeFilter added in v0.38.0

type TraceAttributeFilter struct {
	Key      string                  `json:"key"`
	Value    string                  `json:"value"`
	Operator TraceAttributeOperator  `json:"operator"`
	Type     TraceAttributeValueType `json:"type"`
}

type TraceAttributeOperator added in v0.38.0

type TraceAttributeOperator string
const (
	TraceAttributeOperatorEQ         TraceAttributeOperator = "EQ"
	TraceAttributeOperatorNEQ        TraceAttributeOperator = "NEQ"
	TraceAttributeOperatorGT         TraceAttributeOperator = "GT"
	TraceAttributeOperatorGTE        TraceAttributeOperator = "GTE"
	TraceAttributeOperatorLT         TraceAttributeOperator = "LT"
	TraceAttributeOperatorLTE        TraceAttributeOperator = "LTE"
	TraceAttributeOperatorSTARTSWITH TraceAttributeOperator = "STARTS_WITH"
)

type TraceAttributeValueType added in v0.38.0

type TraceAttributeValueType string
const (
	TraceAttributeValueTypeString TraceAttributeValueType = "string"
	TraceAttributeValueTypeInt    TraceAttributeValueType = "int"
	TraceAttributeValueTypeDouble TraceAttributeValueType = "double"
	TraceAttributeValueTypeBool   TraceAttributeValueType = "bool"
)

type TraceOrder added in v0.38.0

type TraceOrder struct {
	Column    *TraceOrderColumn `json:"column"`
	Direction *OrderDirection   `json:"direction"`
}

type TraceOrderColumn added in v0.38.0

type TraceOrderColumn string
const (
	TraceOrderColumnLATENCY TraceOrderColumn = "LATENCY"
	TraceOrderColumnSTARTAT TraceOrderColumn = "START_AT"
)

type TraceResponse added in v0.38.0

type TraceResponse struct {
	Spans []*Span `json:"spans"`
}

TraceResponse represents the response structure from the traces API

type UpdateAWSIntegrationParam added in v0.18.0

type UpdateAWSIntegrationParam CreateAWSIntegrationParam

UpdateAWSIntegrationParam parameters for UpdateAwsIntegration

type UpdateAlertParam added in v0.23.0

type UpdateAlertParam struct {
	Memo string `json:"memo,omitempty"`
}

UpdateAlertParam is for UpdateAlert

type UpdateAlertResponse added in v0.23.0

type UpdateAlertResponse struct {
	Memo string `json:"memo,omitempty"`
}

UpdateAlertResponse is for UpdateAlert

type UpdateHostParam

type UpdateHostParam CreateHostParam

UpdateHostParam parameters for UpdateHost

type User added in v0.6.0

type User struct {
	ID         string `json:"id,omitempty"`
	ScreenName string `json:"screenName,omitempty"`
	Email      string `json:"email,omitempty"`
	Authority  string `json:"authority,omitempty"`

	IsInRegistrationProcess bool     `json:"isInRegistrationProcess,omitempty"`
	IsMFAEnabled            bool     `json:"isMFAEnabled,omitempty"`
	AuthenticationMethods   []string `json:"authenticationMethods,omitempty"`
	JoinedAt                int64    `json:"joinedAt,omitempty"`
}

User information

type Widget added in v0.6.0

type Widget struct {
	Type           string          `json:"type"`
	Title          string          `json:"title"`
	Layout         Layout          `json:"layout"`
	Metric         Metric          `json:"metric,omitempty"`
	Graph          Graph           `json:"graph,omitempty"`
	Range          Range           `json:"range,omitempty"`
	Markdown       string          `json:"markdown,omitempty"`
	ReferenceLines []ReferenceLine `json:"referenceLines,omitempty"`
	// If this field is nil, it will be treated as a two-digit display after the decimal point.
	FractionSize *int64       `json:"fractionSize,omitempty"`
	Suffix       string       `json:"suffix,omitempty"`
	FormatRules  []FormatRule `json:"formatRules,omitempty"`
	RoleFullName string       `json:"roleFullname,omitempty"`
}

Widget information

Jump to

Keyboard shortcuts

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