Skip to content

Commit

Permalink
Add GetMetricValues function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoog committed Apr 29, 2024
1 parent 0a31a9c commit 4d9d345
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion x-pack/metricbeat/module/azure/service_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@ type Service interface {
GetResourceDefinitions(id []string, group []string, rType string, query string) ([]*armresources.GenericResourceExpanded, error)
GetMetricDefinitionsWithRetry(resourceId string, namespace string) (armmonitor.MetricDefinitionCollection, error)
GetMetricNamespaces(resourceId string) (armmonitor.MetricNamespaceCollection, error)
GetMetricValues(resourceId string, namespace string, timegrain string, timespan string, metricNames []string, aggregations string, filter string) ([]armmonitor.Metric, string, error)
// GetMetricValues returns the metric values for the given resource ID, namespace, timegrain, timespan, metricNames, aggregations and filter.
//
// If the timegrain is empty, the default timegrain for the metric is used and returned.
GetMetricValues(
resourceId string, // resourceId is the ID of the resource to query (e.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}")

Check failure on line 22 in x-pack/metricbeat/module/azure/service_interface.go

View workflow job for this annotation

GitHub Actions / lint (windows)

File is not `goimports`-ed with -local github.com/elastic (goimports)
namespace string, // namespace is the metric namespace to query (e.g. "Microsoft.Compute/virtualMachines")
timegrain string, // timegrain is the timegrain to use for the metric query (e.g. "PT1M"); if empty, returns the default timegrain for the metric.
timespan string, // timespan is the time interval to query (e.g. 2024-04-29T14:03:00Z/2024-04-29T14:04:00Z)
metricNames []string, // metricNames is the list of metric names to query (e.g. ["ServiceApiLatency", "Availability"])
aggregations string, // aggregations is the comma-separated list of aggregations to use for the metric query (e.g. "Average,Maximum,Minimum")
filter string, // filter is the filter to query for dimensions (e.g. "ActivityType eq '*' AND ActivityName eq '*' AND StatusCode eq '*' AND StatusCodeClass eq '*'")
) ([]armmonitor.Metric, string, error)
}

0 comments on commit 4d9d345

Please sign in to comment.