Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Comments

Azure: Allow specifying metrics for custom events#1117

Merged
lzchen merged 1 commit intocensus-instrumentation:masterfrom
Davi-DeGanne:event-measurements
Apr 21, 2022
Merged

Azure: Allow specifying metrics for custom events#1117
lzchen merged 1 commit intocensus-instrumentation:masterfrom
Davi-DeGanne:event-measurements

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

azure Microsoft Azure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants