Documentation ¶
Index ¶
- Constants
- Variables
- type AttributeOnedriveActivity
- type AttributeOutlookActivity
- type AttributeOutlookApps
- type AttributeOutlookQuotas
- type AttributeTeamsDevices
- type MetricBuilderOption
- type MetricConfig
- type MetricsBuilder
- func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics
- func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption)
- func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
- func (mb *MetricsBuilder) RecordM365OnedriveFilesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365OnedriveFilesCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365OnedriveUserActivityCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordM365OutlookAppUserCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordM365OutlookEmailActivityCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordM365OutlookMailboxesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365OutlookQuotaStatusCountDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordM365OutlookStorageUsedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointFilesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointFilesCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointPagesUniqueCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointPagesViewedCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointSiteStorageUsedDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365SharepointSitesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365TeamsCallsCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365TeamsDeviceUsageUsersDataPoint(ts pcommon.Timestamp, val int64, ...)
- func (mb *MetricsBuilder) RecordM365TeamsMeetingsCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365TeamsMessagesPrivateCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) RecordM365TeamsMessagesTeamCountDataPoint(ts pcommon.Timestamp, val int64)
- func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption)
- type MetricsBuilderConfig
- type MetricsConfig
- type ResourceAttributeConfig
- type ResourceAttributesConfig
- type ResourceBuilder
- type ResourceMetricsOption
Constants ¶
const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha )
Variables ¶
var ( Type = component.MustNewType("m365") ScopeName = "github.com/observiq/bindplane-agent/receiver/m365receiver" )
var MapAttributeOnedriveActivity = map[string]AttributeOnedriveActivity{ "view_edit": AttributeOnedriveActivityViewEdit, "synced": AttributeOnedriveActivitySynced, "internal_share": AttributeOnedriveActivityInternalShare, "external_share": AttributeOnedriveActivityExternalShare, }
MapAttributeOnedriveActivity is a helper map of string to AttributeOnedriveActivity attribute value.
var MapAttributeOutlookActivity = map[string]AttributeOutlookActivity{ "read": AttributeOutlookActivityRead, "sent": AttributeOutlookActivitySent, "received": AttributeOutlookActivityReceived, }
MapAttributeOutlookActivity is a helper map of string to AttributeOutlookActivity attribute value.
var MapAttributeOutlookApps = map[string]AttributeOutlookApps{ "pop3": AttributeOutlookAppsPop3, "imap4": AttributeOutlookAppsImap4, "smtp": AttributeOutlookAppsSmtp, "windows": AttributeOutlookAppsWindows, "mac": AttributeOutlookAppsMac, "web": AttributeOutlookAppsWeb, "mobile": AttributeOutlookAppsMobile, "other_mobile": AttributeOutlookAppsOtherMobile, }
MapAttributeOutlookApps is a helper map of string to AttributeOutlookApps attribute value.
var MapAttributeOutlookQuotas = map[string]AttributeOutlookQuotas{ "under_limit": AttributeOutlookQuotasUnderLimit, "warning": AttributeOutlookQuotasWarning, "send_prohibited": AttributeOutlookQuotasSendProhibited, "send_receive_prohibited": AttributeOutlookQuotasSendReceiveProhibited, "indeterminate": AttributeOutlookQuotasIndeterminate, }
MapAttributeOutlookQuotas is a helper map of string to AttributeOutlookQuotas attribute value.
var MapAttributeTeamsDevices = map[string]AttributeTeamsDevices{ "Android": AttributeTeamsDevicesAndroid, "iOS": AttributeTeamsDevicesIOS, "Mac": AttributeTeamsDevicesMac, "Windows": AttributeTeamsDevicesWindows, "Chrome OS": AttributeTeamsDevicesChromeOS, "Linux": AttributeTeamsDevicesLinux, "Web": AttributeTeamsDevicesWeb, }
MapAttributeTeamsDevices is a helper map of string to AttributeTeamsDevices attribute value.
Functions ¶
This section is empty.
Types ¶
type AttributeOnedriveActivity ¶
type AttributeOnedriveActivity int
AttributeOnedriveActivity specifies the a value onedriveActivity attribute.
const ( AttributeOnedriveActivityViewEdit AttributeOnedriveActivity AttributeOnedriveActivitySynced )
func (AttributeOnedriveActivity) String ¶
func (av AttributeOnedriveActivity) String() string
String returns the string representation of the AttributeOnedriveActivity.
type AttributeOutlookActivity ¶
type AttributeOutlookActivity int
AttributeOutlookActivity specifies the a value outlookActivity attribute.
const ( AttributeOutlookActivityRead AttributeOutlookActivity AttributeOutlookActivitySent AttributeOutlookActivityReceived )
func (AttributeOutlookActivity) String ¶
func (av AttributeOutlookActivity) String() string
String returns the string representation of the AttributeOutlookActivity.
type AttributeOutlookApps ¶
type AttributeOutlookApps int
AttributeOutlookApps specifies the a value outlookApps attribute.
const ( AttributeOutlookAppsPop3 AttributeOutlookApps AttributeOutlookAppsImap4 AttributeOutlookAppsSmtp AttributeOutlookAppsWindows AttributeOutlookAppsMac AttributeOutlookAppsWeb AttributeOutlookAppsMobile AttributeOutlookAppsOtherMobile )
func (AttributeOutlookApps) String ¶
func (av AttributeOutlookApps) String() string
String returns the string representation of the AttributeOutlookApps.
type AttributeOutlookQuotas ¶
type AttributeOutlookQuotas int
AttributeOutlookQuotas specifies the a value outlookQuotas attribute.
const ( AttributeOutlookQuotasUnderLimit AttributeOutlookQuotas AttributeOutlookQuotasWarning AttributeOutlookQuotasSendProhibited AttributeOutlookQuotasSendReceiveProhibited AttributeOutlookQuotasIndeterminate )
func (AttributeOutlookQuotas) String ¶
func (av AttributeOutlookQuotas) String() string
String returns the string representation of the AttributeOutlookQuotas.
type AttributeTeamsDevices ¶
type AttributeTeamsDevices int
AttributeTeamsDevices specifies the a value teamsDevices attribute.
const ( AttributeTeamsDevicesAndroid AttributeTeamsDevices AttributeTeamsDevicesIOS AttributeTeamsDevicesMac AttributeTeamsDevicesWindows AttributeTeamsDevicesChromeOS AttributeTeamsDevicesLinux AttributeTeamsDevicesWeb )
func (AttributeTeamsDevices) String ¶
func (av AttributeTeamsDevices) String() string
String returns the string representation of the AttributeTeamsDevices.
type MetricBuilderOption ¶ added in v1.61.0
type MetricBuilderOption interface {
// contains filtered or unexported methods
}
MetricBuilderOption applies changes to default metrics builder.
func WithStartTime ¶
func WithStartTime(startTime pcommon.Timestamp) MetricBuilderOption
WithStartTime sets startTime on the metrics builder.
type MetricConfig ¶
type MetricConfig struct { Enabled bool `mapstructure:"enabled"` // contains filtered or unexported fields }
MetricConfig provides common config for a particular metric.
type MetricsBuilder ¶
type MetricsBuilder struct {
// contains filtered or unexported fields
}
MetricsBuilder provides an interface for scrapers to report metrics while taking care of all the transformations required to produce metric representation defined in metadata and user config.
func NewMetricsBuilder ¶
func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.Settings, options ...MetricBuilderOption) *MetricsBuilder
func (*MetricsBuilder) Emit ¶
func (mb *MetricsBuilder) Emit(options ...ResourceMetricsOption) pmetric.Metrics
Emit returns all the metrics accumulated by the metrics builder and updates the internal state to be ready for recording another set of metrics. This function will be responsible for applying all the transformations required to produce metric representation defined in metadata and user config, e.g. delta or cumulative.
func (*MetricsBuilder) EmitForResource ¶
func (mb *MetricsBuilder) EmitForResource(options ...ResourceMetricsOption)
EmitForResource saves all the generated metrics under a new resource and updates the internal state to be ready for recording another set of data points as part of another resource. This function can be helpful when one scraper needs to emit metrics from several resources. Otherwise calling this function is not required, just `Emit` function can be called instead. Resource attributes should be provided as ResourceMetricsOption arguments.
func (*MetricsBuilder) NewResourceBuilder ¶ added in v1.34.0
func (mb *MetricsBuilder) NewResourceBuilder() *ResourceBuilder
NewResourceBuilder returns a new resource builder that should be used to build a resource associated with for the emitted metrics.
func (*MetricsBuilder) RecordM365OnedriveFilesActiveCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OnedriveFilesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365OnedriveFilesActiveCountDataPoint adds a data point to m365.onedrive.files.active.count metric.
func (*MetricsBuilder) RecordM365OnedriveFilesCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OnedriveFilesCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365OnedriveFilesCountDataPoint adds a data point to m365.onedrive.files.count metric.
func (*MetricsBuilder) RecordM365OnedriveUserActivityCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OnedriveUserActivityCountDataPoint(ts pcommon.Timestamp, val int64, onedriveActivityAttributeValue AttributeOnedriveActivity)
RecordM365OnedriveUserActivityCountDataPoint adds a data point to m365.onedrive.user_activity.count metric.
func (*MetricsBuilder) RecordM365OutlookAppUserCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OutlookAppUserCountDataPoint(ts pcommon.Timestamp, val int64, outlookAppsAttributeValue AttributeOutlookApps)
RecordM365OutlookAppUserCountDataPoint adds a data point to m365.outlook.app.user.count metric.
func (*MetricsBuilder) RecordM365OutlookEmailActivityCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OutlookEmailActivityCountDataPoint(ts pcommon.Timestamp, val int64, outlookActivityAttributeValue AttributeOutlookActivity)
RecordM365OutlookEmailActivityCountDataPoint adds a data point to m365.outlook.email_activity.count metric.
func (*MetricsBuilder) RecordM365OutlookMailboxesActiveCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OutlookMailboxesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365OutlookMailboxesActiveCountDataPoint adds a data point to m365.outlook.mailboxes.active.count metric.
func (*MetricsBuilder) RecordM365OutlookQuotaStatusCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365OutlookQuotaStatusCountDataPoint(ts pcommon.Timestamp, val int64, outlookQuotasAttributeValue AttributeOutlookQuotas)
RecordM365OutlookQuotaStatusCountDataPoint adds a data point to m365.outlook.quota_status.count metric.
func (*MetricsBuilder) RecordM365OutlookStorageUsedDataPoint ¶
func (mb *MetricsBuilder) RecordM365OutlookStorageUsedDataPoint(ts pcommon.Timestamp, val int64)
RecordM365OutlookStorageUsedDataPoint adds a data point to m365.outlook.storage.used metric.
func (*MetricsBuilder) RecordM365SharepointFilesActiveCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointFilesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointFilesActiveCountDataPoint adds a data point to m365.sharepoint.files.active.count metric.
func (*MetricsBuilder) RecordM365SharepointFilesCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointFilesCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointFilesCountDataPoint adds a data point to m365.sharepoint.files.count metric.
func (*MetricsBuilder) RecordM365SharepointPagesUniqueCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointPagesUniqueCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointPagesUniqueCountDataPoint adds a data point to m365.sharepoint.pages.unique.count metric.
func (*MetricsBuilder) RecordM365SharepointPagesViewedCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointPagesViewedCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointPagesViewedCountDataPoint adds a data point to m365.sharepoint.pages.viewed.count metric.
func (*MetricsBuilder) RecordM365SharepointSiteStorageUsedDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointSiteStorageUsedDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointSiteStorageUsedDataPoint adds a data point to m365.sharepoint.site.storage.used metric.
func (*MetricsBuilder) RecordM365SharepointSitesActiveCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365SharepointSitesActiveCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365SharepointSitesActiveCountDataPoint adds a data point to m365.sharepoint.sites.active.count metric.
func (*MetricsBuilder) RecordM365TeamsCallsCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365TeamsCallsCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365TeamsCallsCountDataPoint adds a data point to m365.teams.calls.count metric.
func (*MetricsBuilder) RecordM365TeamsDeviceUsageUsersDataPoint ¶
func (mb *MetricsBuilder) RecordM365TeamsDeviceUsageUsersDataPoint(ts pcommon.Timestamp, val int64, teamsDevicesAttributeValue AttributeTeamsDevices)
RecordM365TeamsDeviceUsageUsersDataPoint adds a data point to m365.teams.device_usage.users metric.
func (*MetricsBuilder) RecordM365TeamsMeetingsCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365TeamsMeetingsCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365TeamsMeetingsCountDataPoint adds a data point to m365.teams.meetings.count metric.
func (*MetricsBuilder) RecordM365TeamsMessagesPrivateCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365TeamsMessagesPrivateCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365TeamsMessagesPrivateCountDataPoint adds a data point to m365.teams.messages.private.count metric.
func (*MetricsBuilder) RecordM365TeamsMessagesTeamCountDataPoint ¶
func (mb *MetricsBuilder) RecordM365TeamsMessagesTeamCountDataPoint(ts pcommon.Timestamp, val int64)
RecordM365TeamsMessagesTeamCountDataPoint adds a data point to m365.teams.messages.team.count metric.
func (*MetricsBuilder) Reset ¶
func (mb *MetricsBuilder) Reset(options ...MetricBuilderOption)
Reset resets metrics builder to its initial state. It should be used when external metrics source is restarted, and metrics builder should update its startTime and reset it's internal state accordingly.
type MetricsBuilderConfig ¶
type MetricsBuilderConfig struct { Metrics MetricsConfig `mapstructure:"metrics"` ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"` }
MetricsBuilderConfig is a configuration for m365 metrics builder.
func DefaultMetricsBuilderConfig ¶
func DefaultMetricsBuilderConfig() MetricsBuilderConfig
type MetricsConfig ¶
type MetricsConfig struct { M365OnedriveFilesActiveCount MetricConfig `mapstructure:"m365.onedrive.files.active.count"` M365OnedriveFilesCount MetricConfig `mapstructure:"m365.onedrive.files.count"` M365OnedriveUserActivityCount MetricConfig `mapstructure:"m365.onedrive.user_activity.count"` M365OutlookAppUserCount MetricConfig `mapstructure:"m365.outlook.app.user.count"` M365OutlookEmailActivityCount MetricConfig `mapstructure:"m365.outlook.email_activity.count"` M365OutlookMailboxesActiveCount MetricConfig `mapstructure:"m365.outlook.mailboxes.active.count"` M365OutlookQuotaStatusCount MetricConfig `mapstructure:"m365.outlook.quota_status.count"` M365OutlookStorageUsed MetricConfig `mapstructure:"m365.outlook.storage.used"` M365TeamsCallsCount MetricConfig `mapstructure:"m365.teams.calls.count"` M365TeamsDeviceUsageUsers MetricConfig `mapstructure:"m365.teams.device_usage.users"` M365TeamsMeetingsCount MetricConfig `mapstructure:"m365.teams.meetings.count"` M365TeamsMessagesPrivateCount MetricConfig `mapstructure:"m365.teams.messages.private.count"` M365TeamsMessagesTeamCount MetricConfig `mapstructure:"m365.teams.messages.team.count"` }
MetricsConfig provides config for m365 metrics.
func DefaultMetricsConfig ¶
func DefaultMetricsConfig() MetricsConfig
type ResourceAttributeConfig ¶
type ResourceAttributeConfig struct { Enabled bool `mapstructure:"enabled"` // Experimental: MetricsInclude defines a list of filters for attribute values. // If the list is not empty, only metrics with matching resource attribute values will be emitted. MetricsInclude []filter.Config `mapstructure:"metrics_include"` // Experimental: MetricsExclude defines a list of filters for attribute values. // If the list is not empty, metrics with matching resource attribute values will not be emitted. // MetricsInclude has higher priority than MetricsExclude. MetricsExclude []filter.Config `mapstructure:"metrics_exclude"` // contains filtered or unexported fields }
ResourceAttributeConfig provides common config for a particular resource attribute.
type ResourceAttributesConfig ¶
type ResourceAttributesConfig struct {
M365TenantID ResourceAttributeConfig `mapstructure:"m365.tenant.id"`
}
ResourceAttributesConfig provides config for m365 resource attributes.
func DefaultResourceAttributesConfig ¶
func DefaultResourceAttributesConfig() ResourceAttributesConfig
type ResourceBuilder ¶ added in v1.34.0
type ResourceBuilder struct {
// contains filtered or unexported fields
}
ResourceBuilder is a helper struct to build resources predefined in metadata.yaml. The ResourceBuilder is not thread-safe and must not to be used in multiple goroutines.
func NewResourceBuilder ¶ added in v1.34.0
func NewResourceBuilder(rac ResourceAttributesConfig) *ResourceBuilder
NewResourceBuilder creates a new ResourceBuilder. This method should be called on the start of the application.
func (*ResourceBuilder) Emit ¶ added in v1.34.0
func (rb *ResourceBuilder) Emit() pcommon.Resource
Emit returns the built resource and resets the internal builder state.
func (*ResourceBuilder) SetM365TenantID ¶ added in v1.34.0
func (rb *ResourceBuilder) SetM365TenantID(val string)
SetM365TenantID sets provided value as "m365.tenant.id" attribute.
type ResourceMetricsOption ¶
type ResourceMetricsOption interface {
// contains filtered or unexported methods
}
ResourceMetricsOption applies changes to provided resource metrics.
func WithResource ¶ added in v1.34.0
func WithResource(res pcommon.Resource) ResourceMetricsOption
WithResource sets the provided resource on the emitted ResourceMetrics. It's recommended to use ResourceBuilder to create the resource.
func WithStartTimeOverride ¶
func WithStartTimeOverride(start pcommon.Timestamp) ResourceMetricsOption
WithStartTimeOverride overrides start time for all the resource metrics data points. This option should be only used if different start time has to be set on metrics coming from different resources.