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

Azure: Allow specifying metrics for custom events #1117

Merged

Conversation

Davi-DeGanne
Copy link
Contributor

Description

This PR adds the ability to specify custom measurements as part of Azure events, emulating the way it was done for custom dimensions.

Testing

I tested this manually using the following python command:

import logging
from opencensus.ext.azure.log_exporter import AzureEventHandler

events = logging.getLogger("myLogger")
events.addHandler(AzureEventHandler())
events.warning("My event", extra={"custom_dimensions":{"type":"Example"},"custom_measurements":{"example_metric":1}})

My Application Insights resource successfully received a custom event with both the customDimensions and customMeasurements properties.

Additional Context

This was requested in a comment in #809 and this PR might be the final piece needed to close that issue, but I'm not sure because the feature request made there isn't very specific.

@google-cla
Copy link

google-cla bot commented Apr 14, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@lzchen
Copy link
Contributor

lzchen commented Apr 15, 2022

Please add a CHANGELOG entry.

@lzchen
Copy link
Contributor

lzchen commented Apr 15, 2022

If you rebase, I believe the build errors will be fixed.

@Davi-DeGanne
Copy link
Contributor Author

@lzchen Ok, how does this look?

@lzchen lzchen merged commit c16e324 into census-instrumentation:master Apr 21, 2022
@lzchen lzchen added the azure Microsoft Azure label Nov 9, 2022
inirudebwoy pushed a commit to inirudebwoy/opencensus-python that referenced this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure Microsoft Azure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants