func()

in receiver/elasticsearchreceiver/scraper.go [420:680]


func (r *elasticsearchScraper) scrapeOneIndexMetrics(now pcommon.Timestamp, name string, stats *model.IndexStatsIndexInfo) {
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.SearchOperations.FetchTotal, metadata.AttributeOperationFetch, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.SearchOperations.QueryTotal, metadata.AttributeOperationQuery, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.IndexingOperations.IndexTotal, metadata.AttributeOperationIndex, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.IndexingOperations.DeleteTotal, metadata.AttributeOperationDelete, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.GetOperation.Total, metadata.AttributeOperationGet, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.SearchOperations.ScrollTotal, metadata.AttributeOperationScroll, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.SearchOperations.SuggestTotal, metadata.AttributeOperationSuggest, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.MergeOperations.Total, metadata.AttributeOperationMerge, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.RefreshOperations.Total, metadata.AttributeOperationRefresh, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.FlushOperations.Total, metadata.AttributeOperationFlush, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Total.WarmerOperations.Total, metadata.AttributeOperationWarmer, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.SearchOperations.FetchTotal, metadata.AttributeOperationFetch, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.SearchOperations.QueryTotal, metadata.AttributeOperationQuery, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.IndexingOperations.IndexTotal, metadata.AttributeOperationIndex, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.IndexingOperations.DeleteTotal, metadata.AttributeOperationDelete, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.GetOperation.Total, metadata.AttributeOperationGet, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.SearchOperations.ScrollTotal, metadata.AttributeOperationScroll, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.SearchOperations.SuggestTotal, metadata.AttributeOperationSuggest, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.MergeOperations.Total, metadata.AttributeOperationMerge, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.RefreshOperations.Total, metadata.AttributeOperationRefresh, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.FlushOperations.Total, metadata.AttributeOperationFlush, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsCompletedDataPoint(
		now, stats.Primaries.WarmerOperations.Total, metadata.AttributeOperationWarmer, metadata.AttributeIndexAggregationTypePrimaryShards,
	)

	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.SearchOperations.FetchTimeInMs, metadata.AttributeOperationFetch, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.SearchOperations.QueryTimeInMs, metadata.AttributeOperationQuery, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.IndexingOperations.IndexTimeInMs, metadata.AttributeOperationIndex, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.IndexingOperations.DeleteTimeInMs, metadata.AttributeOperationDelete, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.GetOperation.TotalTimeInMs, metadata.AttributeOperationGet, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.SearchOperations.ScrollTimeInMs, metadata.AttributeOperationScroll, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.SearchOperations.SuggestTimeInMs, metadata.AttributeOperationSuggest, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.MergeOperations.TotalTimeInMs, metadata.AttributeOperationMerge, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.RefreshOperations.TotalTimeInMs, metadata.AttributeOperationRefresh, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.FlushOperations.TotalTimeInMs, metadata.AttributeOperationFlush, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Total.WarmerOperations.TotalTimeInMs, metadata.AttributeOperationWarmer, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.SearchOperations.FetchTimeInMs, metadata.AttributeOperationFetch, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.SearchOperations.QueryTimeInMs, metadata.AttributeOperationQuery, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.IndexingOperations.IndexTimeInMs, metadata.AttributeOperationIndex, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.IndexingOperations.DeleteTimeInMs, metadata.AttributeOperationDelete, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.GetOperation.TotalTimeInMs, metadata.AttributeOperationGet, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.SearchOperations.ScrollTimeInMs, metadata.AttributeOperationScroll, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.SearchOperations.SuggestTimeInMs, metadata.AttributeOperationSuggest, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.MergeOperations.TotalTimeInMs, metadata.AttributeOperationMerge, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.RefreshOperations.TotalTimeInMs, metadata.AttributeOperationRefresh, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.FlushOperations.TotalTimeInMs, metadata.AttributeOperationFlush, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexOperationsTimeDataPoint(
		now, stats.Primaries.WarmerOperations.TotalTimeInMs, metadata.AttributeOperationWarmer, metadata.AttributeIndexAggregationTypePrimaryShards,
	)

	r.mb.RecordElasticsearchIndexOperationsMergeSizeDataPoint(
		now, stats.Total.MergeOperations.TotalSizeInBytes, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexOperationsMergeDocsCountDataPoint(
		now, stats.Total.MergeOperations.TotalDocs, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexOperationsMergeCurrentDataPoint(
		now, stats.Total.MergeOperations.Current, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexShardsSizeDataPoint(
		now, stats.Total.StoreInfo.SizeInBy, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexSegmentsCountDataPoint(
		now, stats.Total.SegmentsStats.Count, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexSegmentsCountDataPoint(
		now, stats.Primaries.SegmentsStats.Count, metadata.AttributeIndexAggregationTypePrimaryShards,
	)

	r.mb.RecordElasticsearchIndexSegmentsSizeDataPoint(
		now, stats.Total.SegmentsStats.MemoryInBy, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexSegmentsSizeDataPoint(
		now, stats.Primaries.SegmentsStats.MemoryInBy, metadata.AttributeIndexAggregationTypePrimaryShards,
	)

	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Total.SegmentsStats.DocumentValuesMemoryInBy,
		metadata.AttributeIndexAggregationTypeTotal,
		metadata.AttributeSegmentsMemoryObjectTypeDocValue,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Total.SegmentsStats.FixedBitSetMemoryInBy,
		metadata.AttributeIndexAggregationTypeTotal,
		metadata.AttributeSegmentsMemoryObjectTypeFixedBitSet,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Total.SegmentsStats.IndexWriterMemoryInBy,
		metadata.AttributeIndexAggregationTypeTotal,
		metadata.AttributeSegmentsMemoryObjectTypeIndexWriter,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Total.SegmentsStats.TermsMemoryInBy,
		metadata.AttributeIndexAggregationTypeTotal,
		metadata.AttributeSegmentsMemoryObjectTypeTerm,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Primaries.SegmentsStats.DocumentValuesMemoryInBy,
		metadata.AttributeIndexAggregationTypePrimaryShards,
		metadata.AttributeSegmentsMemoryObjectTypeDocValue,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Primaries.SegmentsStats.FixedBitSetMemoryInBy,
		metadata.AttributeIndexAggregationTypePrimaryShards,
		metadata.AttributeSegmentsMemoryObjectTypeFixedBitSet,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Primaries.SegmentsStats.IndexWriterMemoryInBy,
		metadata.AttributeIndexAggregationTypePrimaryShards,
		metadata.AttributeSegmentsMemoryObjectTypeIndexWriter,
	)
	r.mb.RecordElasticsearchIndexSegmentsMemoryDataPoint(
		now,
		stats.Primaries.SegmentsStats.TermsMemoryInBy,
		metadata.AttributeIndexAggregationTypePrimaryShards,
		metadata.AttributeSegmentsMemoryObjectTypeTerm,
	)

	r.mb.RecordElasticsearchIndexTranslogOperationsDataPoint(
		now, stats.Total.TranslogStats.Operations, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexTranslogSizeDataPoint(
		now, stats.Total.TranslogStats.SizeInBy, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexCacheMemoryUsageDataPoint(
		now, stats.Primaries.FieldDataCache.MemorySizeInBy, metadata.AttributeCacheNameFielddata, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexCacheMemoryUsageDataPoint(
		now, stats.Total.FieldDataCache.MemorySizeInBy, metadata.AttributeCacheNameFielddata, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexCacheMemoryUsageDataPoint(
		now, stats.Total.QueryCache.MemorySizeInBy, metadata.AttributeCacheNameQuery, metadata.AttributeIndexAggregationTypeTotal,
	)
	r.mb.RecordElasticsearchIndexCacheMemoryUsageDataPoint(
		now, stats.Primaries.QueryCache.MemorySizeInBy, metadata.AttributeCacheNameQuery, metadata.AttributeIndexAggregationTypePrimaryShards,
	)

	r.mb.RecordElasticsearchIndexCacheSizeDataPoint(
		now, stats.Primaries.QueryCache.CacheSize, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexCacheSizeDataPoint(
		now, stats.Total.QueryCache.CacheSize, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexCacheEvictionsDataPoint(
		now, stats.Primaries.QueryCache.Evictions, metadata.AttributeCacheNameQuery, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexCacheEvictionsDataPoint(
		now, stats.Total.QueryCache.Evictions, metadata.AttributeCacheNameQuery, metadata.AttributeIndexAggregationTypeTotal,
	)

	r.mb.RecordElasticsearchIndexDocumentsDataPoint(
		now, stats.Primaries.DocumentStats.ActiveCount, metadata.AttributeDocumentStateActive, metadata.AttributeIndexAggregationTypePrimaryShards,
	)
	r.mb.RecordElasticsearchIndexDocumentsDataPoint(
		now, stats.Total.DocumentStats.ActiveCount, metadata.AttributeDocumentStateActive, metadata.AttributeIndexAggregationTypeTotal,
	)

	rb := r.mb.NewResourceBuilder()
	rb.SetElasticsearchIndexName(name)
	rb.SetElasticsearchClusterName(r.clusterName)
	r.mb.EmitForResource(metadata.WithResource(rb.Emit()))
}