Sitelet https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1000
Skip to content

Serializing IExtensions into custom dimensions and measurements #1000

Description

@Dmitry-Matveev

Currently, IExtension field on ITelemetry is not delivered to Azure Monitor backend and data is not available for querying/charting in UI experiences.

Serializing IExtension into the custom dimensions and measurements will allow successful delivery / storage and display in Azure Monitor.

For instance, an event with an extension like this:

    public class MyExtension : IExtension
    {
        public int field;
        public string anotherField;

        public IExtension DeepClone()
        {
            var other = new MyExtension();
            other.field = this.field;
            other.anotherField = this.anotherField;

            return other;
        }

        public void Serialize(ISerializationWriter serializationWriter)
        {
            serializationWriter.WriteProperty("Field", this.field);
            serializationWriter.WriteProperty("AnotherField", this.anotherField);
        }
    }
…
...
    RequestTelemetry requestTelemetry = new RequestTelemetry();
    requestTelemetry.Extension = new MyExtension() { field = 42, anotherField = "value" };
    client.TrackRequest(requestTelemetry);

Will appear in Analytics as:
image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions