Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 1.28 KB

File metadata and controls

27 lines (21 loc) · 1.28 KB

CarbonAPI.Client

MIT Nuget

How to use

var factory = new CarbonApiClusterClientFactory(new SilentLog(), "http://url", "login", "password");

var client = factory.Create();

// Create query by tags with aggregations, alias for the last 15 min
var query = MetricTagQueryBuilder.New()
	.AddTag("event", "operations")
	.AddTag("name", "processingTime")
	.AddTag("application", "(Mercury_Vetis_Proxy)", MetricTagOperator.NotLike)
	.AddTag("_aggregate", "p95")
	.AddTag("applicationType", "(ProcessIncomingConsignment|PrepareOutgoingConsignment|GetStockEntryChangesList|GetVetDocumentChangesList)", MetricTagOperator.Like)
	.Summarize(Period.FromMinutes(10), SummarizeFunc.Min)
	.AliasByTags("applicationType")
	.WithPeriod(Period.FromMinutes(15))
	.Build();

// aliasByTags(summarize(seriesByTag('event=operations', 'name=processingTime', 'application!=~(Mercury_Vetis_Proxy)', '_aggregate=p95', 'applicationType=~(ProcessIncomingConsignment|PrepareOutgoingConsignment|GetStockEntryChangesList|GetVetDocumentChangesList)'),'10m', 'min', true), 'applicationType')

var result = await client.GetPointsAsync(query);