Skip to content

Serializing IExtensions into custom dimensions and measurements #1000

Closed

Description

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

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

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