Documentation ¶
Index ¶
- Constants
- type AzureInsightBaseMetricsResult
- type AzureInsightMetricsResult
- type AzureInsightSubscriptionMetricsResult
- type AzureResource
- type AzureServiceDiscovery
- func (sd *AzureServiceDiscovery) FindResourceGraph(ctx context.Context, subscriptions []string, resourceType, filter string) error
- func (sd *AzureServiceDiscovery) FindSubscriptionResources(subscriptionId, filter string)
- func (sd *AzureServiceDiscovery) FindSubscriptionResourcesWithScrapeTags(ctx context.Context, ...)
- func (sd *AzureServiceDiscovery) ResourcesClient(subscriptionId string) (*armresources.Client, error)
- type MetricList
- func (l *MetricList) Add(name string, metric ...MetricRow)
- func (l *MetricList) GetMetricHelp(name string) string
- func (l *MetricList) GetMetricLabelNames(name string) []string
- func (l *MetricList) GetMetricList(name string) []MetricRow
- func (l *MetricList) GetMetricNames() (list []string)
- func (l *MetricList) SetMetricHelp(name, help string)
- type MetricProbeTarget
- type MetricProber
- func (p *MetricProber) AddTarget(targets ...MetricProbeTarget)
- func (p *MetricProber) EnableMetricsCache(cache *cache.Cache, cacheKey string, cacheDuration *time.Duration)
- func (p *MetricProber) EnableServiceDiscoveryCache(cache *cache.Cache, cacheDuration *time.Duration)
- func (p *MetricProber) FetchFromCache() bool
- func (p *MetricProber) FetchMetricsFromTarget(client *armmonitor.MetricsClient, target MetricProbeTarget, ...) (AzureInsightMetricsResult, error)
- func (p *MetricProber) Init()
- func (p *MetricProber) MetricsClient(subscriptionId string) (*armmonitor.MetricsClient, error)
- func (p *MetricProber) RegisterSubscriptionCollectFinishCallback(callback func(subscriptionId string))
- func (p *MetricProber) Run()
- func (p *MetricProber) RunOnSubscriptionScope()
- func (p *MetricProber) SaveToCache()
- func (p *MetricProber) SetAzureClient(client *armclient.ArmClient)
- func (p *MetricProber) SetAzureResourceTagManager(client *armclient.ResourceTagManager)
- func (p *MetricProber) SetPrometheusRegistry(registry *prometheus.Registry)
- func (p *MetricProber) SetUserAgent(value string)
- type MetricRow
- type PrometheusMetricResult
- type RequestMetricSettings
Constants ¶
View Source
const (
AzureMetricApiMaxMetricNumber = 20
)
View Source
const (
MetricHelpDefault = "Azure monitor insight metric"
)
View Source
const (
PrometheusMetricNameDefault = "azurerm_resource_metric"
)
View Source
const (
ResourceGraphQueryTop = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AzureInsightBaseMetricsResult ¶
type AzureInsightBaseMetricsResult struct {
// contains filtered or unexported fields
}
type AzureInsightMetricsResult ¶
type AzureInsightMetricsResult struct { AzureInsightBaseMetricsResult Result *armmonitor.MetricsClientListResponse // contains filtered or unexported fields }
func (*AzureInsightMetricsResult) SendMetricToChannel ¶
func (r *AzureInsightMetricsResult) SendMetricToChannel(channel chan<- PrometheusMetricResult)
type AzureInsightSubscriptionMetricsResult ¶
type AzureInsightSubscriptionMetricsResult struct { AzureInsightBaseMetricsResult Result *armmonitor.MetricsClientListAtSubscriptionScopeResponse // contains filtered or unexported fields }
func (*AzureInsightSubscriptionMetricsResult) SendMetricToChannel ¶
func (r *AzureInsightSubscriptionMetricsResult) SendMetricToChannel(channel chan<- PrometheusMetricResult)
type AzureServiceDiscovery ¶
type AzureServiceDiscovery struct {
// contains filtered or unexported fields
}
func (*AzureServiceDiscovery) FindResourceGraph ¶
func (*AzureServiceDiscovery) FindSubscriptionResources ¶
func (sd *AzureServiceDiscovery) FindSubscriptionResources(subscriptionId, filter string)
func (*AzureServiceDiscovery) FindSubscriptionResourcesWithScrapeTags ¶
func (sd *AzureServiceDiscovery) FindSubscriptionResourcesWithScrapeTags(ctx context.Context, subscriptionId, filter, metricTagName, aggregationTagName string)
func (*AzureServiceDiscovery) ResourcesClient ¶
func (sd *AzureServiceDiscovery) ResourcesClient(subscriptionId string) (*armresources.Client, error)
type MetricList ¶
func NewMetricList ¶
func NewMetricList() *MetricList
func (*MetricList) Add ¶
func (l *MetricList) Add(name string, metric ...MetricRow)
func (*MetricList) GetMetricHelp ¶
func (l *MetricList) GetMetricHelp(name string) string
func (*MetricList) GetMetricLabelNames ¶
func (l *MetricList) GetMetricLabelNames(name string) []string
func (*MetricList) GetMetricList ¶
func (l *MetricList) GetMetricList(name string) []MetricRow
func (*MetricList) GetMetricNames ¶
func (l *MetricList) GetMetricNames() (list []string)
func (*MetricList) SetMetricHelp ¶
func (l *MetricList) SetMetricHelp(name, help string)
type MetricProbeTarget ¶
type MetricProber ¶
type MetricProber struct { Conf config.Opts AzureClient *armclient.ArmClient AzureResourceTagManager *armclient.ResourceTagManager ServiceDiscovery AzureServiceDiscovery // contains filtered or unexported fields }
func NewMetricProber ¶
func NewMetricProber(ctx context.Context, logger *zap.SugaredLogger, w http.ResponseWriter, settings *RequestMetricSettings, conf config.Opts) *MetricProber
func (*MetricProber) AddTarget ¶
func (p *MetricProber) AddTarget(targets ...MetricProbeTarget)
func (*MetricProber) EnableMetricsCache ¶
func (p *MetricProber) EnableMetricsCache(cache *cache.Cache, cacheKey string, cacheDuration *time.Duration)
func (*MetricProber) EnableServiceDiscoveryCache ¶
func (p *MetricProber) EnableServiceDiscoveryCache(cache *cache.Cache, cacheDuration *time.Duration)
func (*MetricProber) FetchFromCache ¶
func (p *MetricProber) FetchFromCache() bool
func (*MetricProber) FetchMetricsFromTarget ¶
func (p *MetricProber) FetchMetricsFromTarget(client *armmonitor.MetricsClient, target MetricProbeTarget, metrics, aggregations []string) (AzureInsightMetricsResult, error)
func (*MetricProber) Init ¶
func (p *MetricProber) Init()
func (*MetricProber) MetricsClient ¶
func (p *MetricProber) MetricsClient(subscriptionId string) (*armmonitor.MetricsClient, error)
func (*MetricProber) RegisterSubscriptionCollectFinishCallback ¶
func (p *MetricProber) RegisterSubscriptionCollectFinishCallback(callback func(subscriptionId string))
func (*MetricProber) Run ¶
func (p *MetricProber) Run()
func (*MetricProber) RunOnSubscriptionScope ¶
func (p *MetricProber) RunOnSubscriptionScope()
func (*MetricProber) SaveToCache ¶
func (p *MetricProber) SaveToCache()
func (*MetricProber) SetAzureClient ¶
func (p *MetricProber) SetAzureClient(client *armclient.ArmClient)
func (*MetricProber) SetAzureResourceTagManager ¶
func (p *MetricProber) SetAzureResourceTagManager(client *armclient.ResourceTagManager)
func (*MetricProber) SetPrometheusRegistry ¶
func (p *MetricProber) SetPrometheusRegistry(registry *prometheus.Registry)
func (*MetricProber) SetUserAgent ¶
func (p *MetricProber) SetUserAgent(value string)
type MetricRow ¶
type MetricRow struct { Labels prometheus.Labels Value float64 }
type PrometheusMetricResult ¶
type PrometheusMetricResult struct { Name string Labels prometheus.Labels Value float64 Help string }
type RequestMetricSettings ¶
type RequestMetricSettings struct { Name string Subscriptions []string ResourceType string Filter string Timespan string Interval *string Metrics []string MetricNamespace string Aggregations []string Regions []string // needed for dimension support MetricTop *int32 MetricFilter string MetricOrderBy string ValidateDimensions bool MetricTemplate string HelpTemplate string DimensionLowercase bool // cache Cache *time.Duration }
func (*RequestMetricSettings) CacheDuration ¶
func (s *RequestMetricSettings) CacheDuration(requestTime time.Time) (ret *time.Duration)
func (*RequestMetricSettings) SetAggregations ¶
func (s *RequestMetricSettings) SetAggregations(val string)
func (*RequestMetricSettings) SetMetrics ¶
func (s *RequestMetricSettings) SetMetrics(val string)
Click to show internal directories.
Click to hide internal directories.