Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Event arguments are not retrieved #15524

Closed
gplumb opened this issue Sep 29, 2020 · 10 comments · Fixed by #15965
Closed

Custom Event arguments are not retrieved #15524

gplumb opened this issue Sep 29, 2020 · 10 comments · Fixed by #15965
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@gplumb
Copy link

gplumb commented Sep 29, 2020

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\

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Sep 29, 2020
@gplumb
Copy link
Author

gplumb commented Sep 29, 2020

An additional note. I can see a similar bug was fixed in the Query library 12 days ago (#13042) - Is this something the Microsoft.Azure.ApplicationInsights package depends on internally? If so, then the fix might just be to rebuild and re-publish this package

@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Monitor - ApplicationInsights needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. labels Sep 29, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 29, 2020
@ghost
Copy link

ghost commented Sep 29, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azmonapplicationinsights.

@jsquire
Copy link
Member

jsquire commented Sep 29, 2020

Thank you for your feedback. Tagging and routing to the team best able to assist.

@jsquire
Copy link
Member

jsquire commented Sep 29, 2020

//cc: @geneh

@gplumb
Copy link
Author

gplumb commented Sep 29, 2020

@geneh
Copy link
Contributor

geneh commented Sep 29, 2020

Yes, please switch to https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights.Query.
Microsoft.Azure.ApplicationInsights should be deprecated.

@gplumb
Copy link
Author

gplumb commented Sep 29, 2020

Fair enough. As well as doing that, would someone mind updating the documentation over here? The sample code will also be out of date now too :-)

@geneh
Copy link
Contributor

geneh commented Sep 29, 2020

Yes, thanks for reporting this.

@older
Copy link

older commented 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.

@geneh
Copy link
Contributor

geneh commented Oct 14, 2020

The documentation has been updated.
https://www.nuget.org/packages/Microsoft.Azure.ApplicationInsights has been deprecated.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
@scottaddie scottaddie added Monitor Monitor, Monitor Ingestion, Monitor Query and removed Monitor - ApplicationInsights labels Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. Monitor Monitor, Monitor Ingestion, Monitor Query needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants