metadata

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsStability = component.StabilityLevelAlpha
)

Variables

View Source
var (
	Type = component.MustNewType("snowflake")
)

Functions

func Meter added in v0.92.0

func Meter(settings component.TelemetrySettings) metric.Meter

func Tracer added in v0.92.0

func Tracer(settings component.TelemetrySettings) trace.Tracer

func WithStartTime

func WithStartTime(startTime pcommon.Timestamp) metricBuilderOption

WithStartTime sets startTime on the metrics builder.

Types

type MetricConfig added in v0.77.0

type MetricConfig struct {
	Enabled bool `mapstructure:"enabled"`
	// contains filtered or unexported fields
}

MetricConfig provides common config for a particular metric.

func (*MetricConfig) Unmarshal added in v0.77.0

func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error

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.CreateSettings, options ...metricBuilderOption) *MetricsBuilder

func (*MetricsBuilder) Emit

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(rmo ...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 v0.83.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) RecordSnowflakeBillingCloudServiceTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingCloudServiceTotalDataPoint(ts pcommon.Timestamp, val float64, serviceTypeAttributeValue string)

RecordSnowflakeBillingCloudServiceTotalDataPoint adds a data point to snowflake.billing.cloud_service.total metric.

func (*MetricsBuilder) RecordSnowflakeBillingTotalCreditTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingTotalCreditTotalDataPoint(ts pcommon.Timestamp, val float64, serviceTypeAttributeValue string)

RecordSnowflakeBillingTotalCreditTotalDataPoint adds a data point to snowflake.billing.total_credit.total metric.

func (*MetricsBuilder) RecordSnowflakeBillingVirtualWarehouseTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingVirtualWarehouseTotalDataPoint(ts pcommon.Timestamp, val float64, serviceTypeAttributeValue string)

RecordSnowflakeBillingVirtualWarehouseTotalDataPoint adds a data point to snowflake.billing.virtual_warehouse.total metric.

func (*MetricsBuilder) RecordSnowflakeBillingWarehouseCloudServiceTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingWarehouseCloudServiceTotalDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeBillingWarehouseCloudServiceTotalDataPoint adds a data point to snowflake.billing.warehouse.cloud_service.total metric.

func (*MetricsBuilder) RecordSnowflakeBillingWarehouseTotalCreditTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingWarehouseTotalCreditTotalDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeBillingWarehouseTotalCreditTotalDataPoint adds a data point to snowflake.billing.warehouse.total_credit.total metric.

func (*MetricsBuilder) RecordSnowflakeBillingWarehouseVirtualWarehouseTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeBillingWarehouseVirtualWarehouseTotalDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeBillingWarehouseVirtualWarehouseTotalDataPoint adds a data point to snowflake.billing.warehouse.virtual_warehouse.total metric.

func (*MetricsBuilder) RecordSnowflakeDatabaseBytesScannedAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeDatabaseBytesScannedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeDatabaseBytesScannedAvgDataPoint adds a data point to snowflake.database.bytes_scanned.avg metric.

func (*MetricsBuilder) RecordSnowflakeDatabaseQueryCountDataPoint

func (mb *MetricsBuilder) RecordSnowflakeDatabaseQueryCountDataPoint(ts pcommon.Timestamp, val int64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeDatabaseQueryCountDataPoint adds a data point to snowflake.database.query.count metric.

func (*MetricsBuilder) RecordSnowflakeLoginsTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeLoginsTotalDataPoint(ts pcommon.Timestamp, val int64, errorMessageAttributeValue string, reportedClientTypeAttributeValue string, isSuccessAttributeValue string)

RecordSnowflakeLoginsTotalDataPoint adds a data point to snowflake.logins.total metric.

func (*MetricsBuilder) RecordSnowflakePipeCreditsUsedTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakePipeCreditsUsedTotalDataPoint(ts pcommon.Timestamp, val float64, pipeNameAttributeValue string)

RecordSnowflakePipeCreditsUsedTotalDataPoint adds a data point to snowflake.pipe.credits_used.total metric.

func (*MetricsBuilder) RecordSnowflakeQueryBlockedDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueryBlockedDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeQueryBlockedDataPoint adds a data point to snowflake.query.blocked metric.

func (*MetricsBuilder) RecordSnowflakeQueryBytesDeletedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryBytesDeletedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryBytesDeletedAvgDataPoint adds a data point to snowflake.query.bytes_deleted.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryBytesSpilledLocalAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryBytesSpilledLocalAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryBytesSpilledLocalAvgDataPoint adds a data point to snowflake.query.bytes_spilled.local.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryBytesSpilledRemoteAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryBytesSpilledRemoteAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryBytesSpilledRemoteAvgDataPoint adds a data point to snowflake.query.bytes_spilled.remote.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryBytesWrittenAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryBytesWrittenAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryBytesWrittenAvgDataPoint adds a data point to snowflake.query.bytes_written.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryCompilationTimeAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryCompilationTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryCompilationTimeAvgDataPoint adds a data point to snowflake.query.compilation_time.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryDataScannedCacheAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueryDataScannedCacheAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryDataScannedCacheAvgDataPoint adds a data point to snowflake.query.data_scanned_cache.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryExecutedDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueryExecutedDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeQueryExecutedDataPoint adds a data point to snowflake.query.executed metric.

func (*MetricsBuilder) RecordSnowflakeQueryExecutionTimeAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryExecutionTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryExecutionTimeAvgDataPoint adds a data point to snowflake.query.execution_time.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryPartitionsScannedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeQueryPartitionsScannedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueryPartitionsScannedAvgDataPoint adds a data point to snowflake.query.partitions_scanned.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueryQueuedOverloadDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueryQueuedOverloadDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeQueryQueuedOverloadDataPoint adds a data point to snowflake.query.queued_overload metric.

func (*MetricsBuilder) RecordSnowflakeQueryQueuedProvisionDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueryQueuedProvisionDataPoint(ts pcommon.Timestamp, val float64, warehouseNameAttributeValue string)

RecordSnowflakeQueryQueuedProvisionDataPoint adds a data point to snowflake.query.queued_provision metric.

func (*MetricsBuilder) RecordSnowflakeQueuedOverloadTimeAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueuedOverloadTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueuedOverloadTimeAvgDataPoint adds a data point to snowflake.queued_overload_time.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueuedProvisioningTimeAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueuedProvisioningTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueuedProvisioningTimeAvgDataPoint adds a data point to snowflake.queued_provisioning_time.avg metric.

func (*MetricsBuilder) RecordSnowflakeQueuedRepairTimeAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeQueuedRepairTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeQueuedRepairTimeAvgDataPoint adds a data point to snowflake.queued_repair_time.avg metric.

func (*MetricsBuilder) RecordSnowflakeRowsDeletedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeRowsDeletedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeRowsDeletedAvgDataPoint adds a data point to snowflake.rows_deleted.avg metric.

func (*MetricsBuilder) RecordSnowflakeRowsInsertedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeRowsInsertedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeRowsInsertedAvgDataPoint adds a data point to snowflake.rows_inserted.avg metric.

func (*MetricsBuilder) RecordSnowflakeRowsProducedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeRowsProducedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeRowsProducedAvgDataPoint adds a data point to snowflake.rows_produced.avg metric.

func (*MetricsBuilder) RecordSnowflakeRowsUnloadedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeRowsUnloadedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeRowsUnloadedAvgDataPoint adds a data point to snowflake.rows_unloaded.avg metric.

func (*MetricsBuilder) RecordSnowflakeRowsUpdatedAvgDataPoint added in v0.70.0

func (mb *MetricsBuilder) RecordSnowflakeRowsUpdatedAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeRowsUpdatedAvgDataPoint adds a data point to snowflake.rows_updated.avg metric.

func (*MetricsBuilder) RecordSnowflakeSessionIDCountDataPoint

func (mb *MetricsBuilder) RecordSnowflakeSessionIDCountDataPoint(ts pcommon.Timestamp, val int64, userNameAttributeValue string)

RecordSnowflakeSessionIDCountDataPoint adds a data point to snowflake.session_id.count metric.

func (*MetricsBuilder) RecordSnowflakeStorageFailsafeBytesTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeStorageFailsafeBytesTotalDataPoint(ts pcommon.Timestamp, val int64)

RecordSnowflakeStorageFailsafeBytesTotalDataPoint adds a data point to snowflake.storage.failsafe_bytes.total metric.

func (*MetricsBuilder) RecordSnowflakeStorageStageBytesTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeStorageStageBytesTotalDataPoint(ts pcommon.Timestamp, val int64)

RecordSnowflakeStorageStageBytesTotalDataPoint adds a data point to snowflake.storage.stage_bytes.total metric.

func (*MetricsBuilder) RecordSnowflakeStorageStorageBytesTotalDataPoint

func (mb *MetricsBuilder) RecordSnowflakeStorageStorageBytesTotalDataPoint(ts pcommon.Timestamp, val int64)

RecordSnowflakeStorageStorageBytesTotalDataPoint adds a data point to snowflake.storage.storage_bytes.total metric.

func (*MetricsBuilder) RecordSnowflakeTotalElapsedTimeAvgDataPoint

func (mb *MetricsBuilder) RecordSnowflakeTotalElapsedTimeAvgDataPoint(ts pcommon.Timestamp, val float64, schemaNameAttributeValue string, executionStatusAttributeValue string, errorMessageAttributeValue string, queryTypeAttributeValue string, warehouseNameAttributeValue string, databaseNameAttributeValue string, warehouseSizeAttributeValue string)

RecordSnowflakeTotalElapsedTimeAvgDataPoint adds a data point to snowflake.total_elapsed_time.avg 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 added in v0.73.0

type MetricsBuilderConfig struct {
	Metrics            MetricsConfig            `mapstructure:"metrics"`
	ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
}

MetricsBuilderConfig is a configuration for snowflake metrics builder.

func DefaultMetricsBuilderConfig added in v0.73.0

func DefaultMetricsBuilderConfig() MetricsBuilderConfig

type MetricsConfig added in v0.77.0

type MetricsConfig struct {
	SnowflakeBillingCloudServiceTotal              MetricConfig `mapstructure:"snowflake.billing.cloud_service.total"`
	SnowflakeBillingTotalCreditTotal               MetricConfig `mapstructure:"snowflake.billing.total_credit.total"`
	SnowflakeBillingVirtualWarehouseTotal          MetricConfig `mapstructure:"snowflake.billing.virtual_warehouse.total"`
	SnowflakeBillingWarehouseCloudServiceTotal     MetricConfig `mapstructure:"snowflake.billing.warehouse.cloud_service.total"`
	SnowflakeBillingWarehouseTotalCreditTotal      MetricConfig `mapstructure:"snowflake.billing.warehouse.total_credit.total"`
	SnowflakeBillingWarehouseVirtualWarehouseTotal MetricConfig `mapstructure:"snowflake.billing.warehouse.virtual_warehouse.total"`
	SnowflakeDatabaseBytesScannedAvg               MetricConfig `mapstructure:"snowflake.database.bytes_scanned.avg"`
	SnowflakeDatabaseQueryCount                    MetricConfig `mapstructure:"snowflake.database.query.count"`
	SnowflakeLoginsTotal                           MetricConfig `mapstructure:"snowflake.logins.total"`
	SnowflakePipeCreditsUsedTotal                  MetricConfig `mapstructure:"snowflake.pipe.credits_used.total"`
	SnowflakeQueryBlocked                          MetricConfig `mapstructure:"snowflake.query.blocked"`
	SnowflakeQueryBytesDeletedAvg                  MetricConfig `mapstructure:"snowflake.query.bytes_deleted.avg"`
	SnowflakeQueryBytesSpilledLocalAvg             MetricConfig `mapstructure:"snowflake.query.bytes_spilled.local.avg"`
	SnowflakeQueryBytesSpilledRemoteAvg            MetricConfig `mapstructure:"snowflake.query.bytes_spilled.remote.avg"`
	SnowflakeQueryBytesWrittenAvg                  MetricConfig `mapstructure:"snowflake.query.bytes_written.avg"`
	SnowflakeQueryCompilationTimeAvg               MetricConfig `mapstructure:"snowflake.query.compilation_time.avg"`
	SnowflakeQueryDataScannedCacheAvg              MetricConfig `mapstructure:"snowflake.query.data_scanned_cache.avg"`
	SnowflakeQueryExecuted                         MetricConfig `mapstructure:"snowflake.query.executed"`
	SnowflakeQueryExecutionTimeAvg                 MetricConfig `mapstructure:"snowflake.query.execution_time.avg"`
	SnowflakeQueryPartitionsScannedAvg             MetricConfig `mapstructure:"snowflake.query.partitions_scanned.avg"`
	SnowflakeQueryQueuedOverload                   MetricConfig `mapstructure:"snowflake.query.queued_overload"`
	SnowflakeQueryQueuedProvision                  MetricConfig `mapstructure:"snowflake.query.queued_provision"`
	SnowflakeQueuedOverloadTimeAvg                 MetricConfig `mapstructure:"snowflake.queued_overload_time.avg"`
	SnowflakeQueuedProvisioningTimeAvg             MetricConfig `mapstructure:"snowflake.queued_provisioning_time.avg"`
	SnowflakeQueuedRepairTimeAvg                   MetricConfig `mapstructure:"snowflake.queued_repair_time.avg"`
	SnowflakeRowsDeletedAvg                        MetricConfig `mapstructure:"snowflake.rows_deleted.avg"`
	SnowflakeRowsInsertedAvg                       MetricConfig `mapstructure:"snowflake.rows_inserted.avg"`
	SnowflakeRowsProducedAvg                       MetricConfig `mapstructure:"snowflake.rows_produced.avg"`
	SnowflakeRowsUnloadedAvg                       MetricConfig `mapstructure:"snowflake.rows_unloaded.avg"`
	SnowflakeRowsUpdatedAvg                        MetricConfig `mapstructure:"snowflake.rows_updated.avg"`
	SnowflakeSessionIDCount                        MetricConfig `mapstructure:"snowflake.session_id.count"`
	SnowflakeStorageFailsafeBytesTotal             MetricConfig `mapstructure:"snowflake.storage.failsafe_bytes.total"`
	SnowflakeStorageStageBytesTotal                MetricConfig `mapstructure:"snowflake.storage.stage_bytes.total"`
	SnowflakeStorageStorageBytesTotal              MetricConfig `mapstructure:"snowflake.storage.storage_bytes.total"`
	SnowflakeTotalElapsedTimeAvg                   MetricConfig `mapstructure:"snowflake.total_elapsed_time.avg"`
}

MetricsConfig provides config for snowflake metrics.

func DefaultMetricsConfig added in v0.77.0

func DefaultMetricsConfig() MetricsConfig

type ResourceAttributeConfig added in v0.77.0

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.

func (*ResourceAttributeConfig) Unmarshal added in v0.87.0

func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error

type ResourceAttributesConfig added in v0.77.0

type ResourceAttributesConfig struct {
	SnowflakeAccountName ResourceAttributeConfig `mapstructure:"snowflake.account.name"`
}

ResourceAttributesConfig provides config for snowflake resource attributes.

func DefaultResourceAttributesConfig added in v0.77.0

func DefaultResourceAttributesConfig() ResourceAttributesConfig

type ResourceBuilder added in v0.82.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 v0.82.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 v0.82.0

func (rb *ResourceBuilder) Emit() pcommon.Resource

Emit returns the built resource and resets the internal builder state.

func (*ResourceBuilder) SetSnowflakeAccountName added in v0.82.0

func (rb *ResourceBuilder) SetSnowflakeAccountName(val string)

SetSnowflakeAccountName sets provided value as "snowflake.account.name" attribute.

type ResourceMetricsOption

type ResourceMetricsOption func(pmetric.ResourceMetrics)

ResourceMetricsOption applies changes to provided resource metrics.

func WithResource added in v0.82.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.

Jump to

Keyboard shortcuts

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