string source = string.IsNullOrEmpty(this.logger.PStore[Constants.CurrentKey]) ? "NA" : this.logger.PStore[Constants.CurrentKey];
string cId = string.IsNullOrEmpty(this.logger.Store[Constants.CId]) ? "NA" : this.logger.Store[Constants.CId];
public virtual void GetMetric(string metricId, double metricValue, string source = "", string cId = "")
{
Metric metric = this.TelemetryClient.GetMetric(metricId, "Source", "CorrelationId");
metric.TrackValue(metricValue, source, cId);
}
The above code I am using to log data in app insight.GetMetric has 2 dimensions along with a metricId and Track value has value along with dimension.
Microsoft.ApplicationInsights, Version=2.17.0.146