Skip to content

Commit

Permalink
dimension names
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabh1007 committed Sep 26, 2024
1 parent c16a97a commit fb81cfa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public void CollectOperationAndNetworkInfo(Func<TelemetryInformation> getTelemet

Func<KeyValuePair<string, object>[]> dimensionsFunc = () => new[]
{
new KeyValuePair<string, object>("AccountName", this.accountName),
new KeyValuePair<string, object>("Container", telemetryInformation.ContainerId),
new KeyValuePair<string, object>("Database", telemetryInformation.DatabaseId),
new KeyValuePair<string, object>("Operation", telemetryInformation.OperationType),
new KeyValuePair<string, object>("OperationStatusCode", telemetryInformation.StatusCode),
new KeyValuePair<string, object>("ClientCorrelationId", this.clientId),
new KeyValuePair<string, object>("ConsistencyLevel", telemetryInformation.ConsistencyLevel),
new KeyValuePair<string, object>("PartitionKeyRangeId", telemetryInformation.PartitionKeyRangeId),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.AccountName., this.accountName),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.ContainerName, telemetryInformation.ContainerId),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.DbName, telemetryInformation.DatabaseId),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.OperationType, telemetryInformation.OperationType),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.StatusCode, telemetryInformation.StatusCode),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.SubStatusCode, this.clientId),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.SubStatusCode, telemetryInformation.ConsistencyLevel),
new KeyValuePair<string, object>(OpenTelemetryAttributeKeys.PartitionKeyRangeId, telemetryInformation.PartitionKeyRangeId),
};

CosmosOperationMeter.RecordMaxItemCount(Convert.ToInt32(telemetryInformation.MaxItemCount), dimensionsFunc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,16 @@ internal sealed class OpenTelemetryAttributeKeys
/// Represents the stack trace of the exception.
/// </summary>
public const string ExceptionStacktrace = "exception.stacktrace";

/// <summary>
/// AccountName
/// </summary>
public const string AccountName = "db.cosmosdb.account_name";

/// <summary>
/// PartitionKeyRangeId
/// </summary>
public const string PartitionKeyRangeId = "db.cosmosdb.partition_key_range_id";

}
}

0 comments on commit fb81cfa

Please sign in to comment.