question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom Event arguments are not retrieved

See original GitHub issue

I am trying to retrieve custom event data from Application Insights using this package: https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights

The custom event names are being correctly deserialized, but the custom event data (which is passed via a TelemetryClient object in another solution) isn’t. The data is available in the Azure portal, so there is either a bug in the API surface being used by this library or (more likely) the deserialization code.

Expected: EventsCustomEventResult.CustomDimensions and EventsCustomEventResult.CustomMeasurements are not null (ideally the additional properties should contain a list of string names and string pairs, respectively).

Actual: The object is null for custom events that do contain custom properties.

Repro: Ensure that custom events with additional properties exist in an ApplicationInsights instance (This is easily done with the TelemetryClient) and then run this code:

var activeDirectoryServiceSettings = new ActiveDirectoryServiceSettings
{
    AuthenticationEndpoint = new Uri("https://login.microsoftonline.com"),
    TokenAudience = new Uri("https://api.applicationinsights.io/"),
    ValidateAuthority = true
};

var serviceCredentials = ApplicationTokenProvider.LoginSilentAsync(
        domain: "< DOMAIN >",
        clientId: "< CLIENT ID >",
        secret: "< SECRET >",
        settings: activeDirectoryServiceSettings)
    .GetAwaiter()
    .GetResult();

_applicationInsightsDataClient = new ApplicationInsightsDataClient(serviceCredentials)
{
    AppId = "< APP ID >"
};

var events = _applicationInsightsDataClient.GetCustomEvents(TimeSpan.FromHours(72));

foreach (var e in events.Value)
{
    // EXPECTED:
    // e.CustomDimensions.AdditionalProperties != null
    // e.CustomMeasurements.AdditionalProperties != null
}

.NET Core SDK (reflecting any global.json): Version: 3.1.402 Commit: 9b5de826fd

Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.1.402\

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
genehcommented, Oct 14, 2020
1reaction
oldercommented, Sep 29, 2020

@geneh It looks like the same fix which was applied to EventsResultDataCustomDimensions in 58a48f0 needs to be applied to EventsResultDataCustomMeasurements as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why can't I directly pass a custom event args class into ...
I'm a little confused by not seeing any custom EventArgs class. You can't make a method signature like static void myClass_MyEvent(object ...
Read more >
Firebase custom event parameter is missing
I imported FirebaseAnalytics.unitypackage into my project and am trying to make a custom event with a parameter. The event was successfully ...
Read more >
How to pass custom arguments to issue event?
Solved: Hello! Is it possible to add custom arguments in post-function (or somewhere else) that can be accessed by issue event listener in....
Read more >
Events node | Visual Scripting | 1.7.8
There is a special type of event, the Custom Event that triggers custom events across graphs, along with their custom arguments.
Read more >
FileNet P8 - Working with Subscriptions
Because the EventStatus property can be set only on a created event, an instance of a custom event must be created and not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found