Skip to content

Instantly share code, notes, and snippets.

# global specifies parameters that are valid in all other configuration contexts.
global:
scrape_interval: 15s # how frequently to scrape targets by default.
scrape_timeout: 10s # how long until a scrape request times out.
evaluation_interval: 15s # how frequently to evaluate rules
# Rule files specifies a list of globs. Rules and alerts are read from all matching files
rule_files:
# scrape_config section specifies a set of targets and parameters describing how to scrape them.
{
"read": "2019-12-02T14:24:52.3532632-05:00",
"preread": "2019-12-02T14:24:51.3437784-05:00",
"pids_stats": {},
"blkio_stats": {
"io_service_bytes_recursive": null,
"io_serviced_recursive": null,
"io_queue_recursive": null,
"io_service_time_recursive": null,
"io_wait_time_recursive": null,
protected ItemModel GetBucketItem(object identifierValue, IItemModelRepository repository,
Plugins.ResolveSitecoreItemSettings resolveItemSettings, PipelineContext pipelineContext)
{
string[] identifierSegments = identifierValue.ToString().Split(new[] { '-' });
var itemPath = string.Join("/", identifierSegments, 0, resolveItemSettings.BucketFolderDepth);
var bucketItemPath = resolveItemSettings.BucketRootPath + itemPath + "/" + identifierValue;
ItemModel itemModel = repository.Get(bucketItemPath);
if (itemModel != null)
{
Log(
IEnumerable<ItemModel> enumerable = repository.Search(new ItemSearchSettings
{
SearchFilters =
{
new SearchFilter
{
FieldName = sitecoreItemFieldReader.FieldName,
Value = text
},
new SearchFilter
protected virtual ItemModel DoSearch(object value, Plugins.ResolveSitecoreItemEnhancedSettings resolveItemSettings, IItemModelRepository repository, ILogger logger, PipelineContext pipelineContext)
{
if (!(GetValueReader(resolveItemSettings.MatchingFieldValueAccessor) is SitecoreItemFieldReader sitecoreItemFieldReader))
{
Log(
logger.Error,
pipelineContext,
"The matching field value accessor is not a valid Sitecore item field reader.");
return null;
}