Package monitoring
Overview ▹
Index ▹
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
func GroupGroupPath ¶
func GroupGroupPath(project, group string) string
GroupGroupPath returns the path for the group resource.
func GroupProjectPath ¶
func GroupProjectPath(project string) string
GroupProjectPath returns the path for the project resource.
func MetricMetricDescriptorPath ¶
func MetricMetricDescriptorPath(project, metricDescriptor string) string
MetricMetricDescriptorPath returns the path for the metric descriptor resource.
func MetricMonitoredResourceDescriptorPath ¶
func MetricMonitoredResourceDescriptorPath(project, monitoredResourceDescriptor string) string
MetricMonitoredResourceDescriptorPath returns the path for the monitored resource descriptor resource.
func MetricProjectPath ¶
func MetricProjectPath(project string) string
MetricProjectPath returns the path for the project resource.
type GroupCallOptions ¶
GroupCallOptions contains the retry settings for each method of GroupClient.
type GroupCallOptions struct { ListGroups []gax.CallOption GetGroup []gax.CallOption CreateGroup []gax.CallOption UpdateGroup []gax.CallOption DeleteGroup []gax.CallOption ListGroupMembers []gax.CallOption }
type GroupClient ¶
GroupClient is a client for interacting with Stackdriver Monitoring API.
type GroupClient struct { // The call options for this service. CallOptions *GroupCallOptions // contains filtered or unexported fields }
func NewGroupClient ¶
func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupClient, error)
NewGroupClient creates a new group service client.
The Group API lets you inspect and manage your [groups](google.monitoring.v3.Group).
A group is a named filter that is used to identify a collection of monitored resources. Groups are typically used to mirror the physical and/or logical topology of the environment. Because group membership is computed dynamically, monitored resources that are started in the future are automatically placed in matching groups. By using a group to name monitored resources in, for example, an alert policy, the target of that alert policy is updated automatically as monitored resources are added and removed from the infrastructure.
▹ Example
func (*GroupClient) Close ¶
func (c *GroupClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*GroupClient) Connection ¶
func (c *GroupClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*GroupClient) CreateGroup ¶
func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
CreateGroup creates a new group.
▹ Example
func (*GroupClient) DeleteGroup ¶
func (c *GroupClient) DeleteGroup(ctx context.Context, req *monitoringpb.DeleteGroupRequest, opts ...gax.CallOption) error
DeleteGroup deletes an existing group.
▹ Example
func (*GroupClient) GetGroup ¶
func (c *GroupClient) GetGroup(ctx context.Context, req *monitoringpb.GetGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
GetGroup gets a single group.
▹ Example
func (*GroupClient) ListGroupMembers ¶
func (c *GroupClient) ListGroupMembers(ctx context.Context, req *monitoringpb.ListGroupMembersRequest, opts ...gax.CallOption) *MonitoredResourceIterator
ListGroupMembers lists the monitored resources that are members of a group.
▹ Example
func (*GroupClient) ListGroups ¶
func (c *GroupClient) ListGroups(ctx context.Context, req *monitoringpb.ListGroupsRequest, opts ...gax.CallOption) *GroupIterator
ListGroups lists the existing groups.
▹ Example
func (*GroupClient) SetGoogleClientInfo ¶
func (c *GroupClient) SetGoogleClientInfo(keyval ...string)
SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.
func (*GroupClient) UpdateGroup ¶
func (c *GroupClient) UpdateGroup(ctx context.Context, req *monitoringpb.UpdateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
UpdateGroup updates an existing group. You can change any group attributes except `name`.
▹ Example
type GroupIterator ¶
GroupIterator manages a stream of *monitoringpb.Group.
type GroupIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.Group, nextPageToken string, err error) // contains filtered or unexported fields }
func (*GroupIterator) Next ¶
func (it *GroupIterator) Next() (*monitoringpb.Group, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*GroupIterator) PageInfo ¶
func (it *GroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MetricCallOptions ¶
MetricCallOptions contains the retry settings for each method of MetricClient.
type MetricCallOptions struct { ListMonitoredResourceDescriptors []gax.CallOption GetMonitoredResourceDescriptor []gax.CallOption ListMetricDescriptors []gax.CallOption GetMetricDescriptor []gax.CallOption CreateMetricDescriptor []gax.CallOption DeleteMetricDescriptor []gax.CallOption ListTimeSeries []gax.CallOption CreateTimeSeries []gax.CallOption }
type MetricClient ¶
MetricClient is a client for interacting with Stackdriver Monitoring API.
type MetricClient struct { // The call options for this service. CallOptions *MetricCallOptions // contains filtered or unexported fields }
func NewMetricClient ¶
func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricClient, error)
NewMetricClient creates a new metric service client.
Manages metric descriptors, monitored resource descriptors, and time series data.
▹ Example
func (*MetricClient) Close ¶
func (c *MetricClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*MetricClient) Connection ¶
func (c *MetricClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*MetricClient) CreateMetricDescriptor ¶
func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitoringpb.CreateMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error)
CreateMetricDescriptor creates a new metric descriptor. User-created metric descriptors define [custom metrics](/monitoring/custom-metrics).
▹ Example
func (*MetricClient) CreateTimeSeries ¶
func (c *MetricClient) CreateTimeSeries(ctx context.Context, req *monitoringpb.CreateTimeSeriesRequest, opts ...gax.CallOption) error
CreateTimeSeries creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.
▹ Example
func (*MetricClient) DeleteMetricDescriptor ¶
func (c *MetricClient) DeleteMetricDescriptor(ctx context.Context, req *monitoringpb.DeleteMetricDescriptorRequest, opts ...gax.CallOption) error
DeleteMetricDescriptor deletes a metric descriptor. Only user-created [custom metrics](/monitoring/custom-metrics) can be deleted.
▹ Example
func (*MetricClient) GetMetricDescriptor ¶
func (c *MetricClient) GetMetricDescriptor(ctx context.Context, req *monitoringpb.GetMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error)
GetMetricDescriptor gets a single metric descriptor. This method does not require a Stackdriver account.
▹ Example
func (*MetricClient) GetMonitoredResourceDescriptor ¶
func (c *MetricClient) GetMonitoredResourceDescriptor(ctx context.Context, req *monitoringpb.GetMonitoredResourceDescriptorRequest, opts ...gax.CallOption) (*monitoredrespb.MonitoredResourceDescriptor, error)
GetMonitoredResourceDescriptor gets a single monitored resource descriptor. This method does not require a Stackdriver account.
▹ Example
func (*MetricClient) ListMetricDescriptors ¶
func (c *MetricClient) ListMetricDescriptors(ctx context.Context, req *monitoringpb.ListMetricDescriptorsRequest, opts ...gax.CallOption) *MetricDescriptorIterator
ListMetricDescriptors lists metric descriptors that match a filter. This method does not require a Stackdriver account.
▹ Example
func (*MetricClient) ListMonitoredResourceDescriptors ¶
func (c *MetricClient) ListMonitoredResourceDescriptors(ctx context.Context, req *monitoringpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator
ListMonitoredResourceDescriptors lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.
▹ Example
func (*MetricClient) ListTimeSeries ¶
func (c *MetricClient) ListTimeSeries(ctx context.Context, req *monitoringpb.ListTimeSeriesRequest, opts ...gax.CallOption) *TimeSeriesIterator
ListTimeSeries lists time series that match a filter. This method does not require a Stackdriver account.
▹ Example
func (*MetricClient) SetGoogleClientInfo ¶
func (c *MetricClient) SetGoogleClientInfo(keyval ...string)
SetGoogleClientInfo sets the name and version of the application in the `x-goog-api-client` header passed on each request. Intended for use by Google-written clients.
type MetricDescriptorIterator ¶
MetricDescriptorIterator manages a stream of *metricpb.MetricDescriptor.
type MetricDescriptorIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*metricpb.MetricDescriptor, nextPageToken string, err error) // contains filtered or unexported fields }
func (*MetricDescriptorIterator) Next ¶
func (it *MetricDescriptorIterator) Next() (*metricpb.MetricDescriptor, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MetricDescriptorIterator) PageInfo ¶
func (it *MetricDescriptorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MonitoredResourceDescriptorIterator ¶
MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor.
type MonitoredResourceDescriptorIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResourceDescriptor, nextPageToken string, err error) // contains filtered or unexported fields }
func (*MonitoredResourceDescriptorIterator) Next ¶
func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MonitoredResourceDescriptorIterator) PageInfo ¶
func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MonitoredResourceIterator ¶
MonitoredResourceIterator manages a stream of *monitoredrespb.MonitoredResource.
type MonitoredResourceIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResource, nextPageToken string, err error) // contains filtered or unexported fields }
func (*MonitoredResourceIterator) Next ¶
func (it *MonitoredResourceIterator) Next() (*monitoredrespb.MonitoredResource, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MonitoredResourceIterator) PageInfo ¶
func (it *MonitoredResourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TimeSeriesIterator ¶
TimeSeriesIterator manages a stream of *monitoringpb.TimeSeries.
type TimeSeriesIterator struct { // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*monitoringpb.TimeSeries, nextPageToken string, err error) // contains filtered or unexported fields }
func (*TimeSeriesIterator) Next ¶
func (it *TimeSeriesIterator) Next() (*monitoringpb.TimeSeries, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TimeSeriesIterator) PageInfo ¶
func (it *TimeSeriesIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.