CustomDimension not working
See original GitHub issueDescribe your environment.
Version: python3.6
Running as a container in RHEL VM.
After importing opencensus.ext.azure.log_exporter
docker image is built only when the Dockerfile is changed to have
RUN yum install -y gcc rh-python36 rh-python36-python-devel.x86_64
Steps to reproduce. logger.py
import logging
import os
from opencensus.ext.azure.log_exporter import AzureLogHandler
_azhandler = AzureLogHandler(connection_string='InstrumentationKey={}'.format(os.getenv('app_insights_instrumentation_key')))
_azhandler.setLevel(logging.DEBUG)
_azhandler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
_azlogger = logging.getLogger('FileUploader')
_azlogger.addHandler(_azhandler)
def info_customdimension(message, customDictionary):
try:
_azlogger.info(message, extra=customDictionary)
print('Sent custom dictionary log')
except Exception:
print('Cannot send custom dictionary log')
Consumer of this logger file
custom_dimensions = {}
custom_dimensions['JobId'] = job_id
custom_dimensions['FileUpload'] = True
custom_properties = {}
custom_properties['custom_dimensions'] = custom_dimensions
info_customdimension("Successfully uploaded'), custom_properties)
What is the expected behavior? Application insights log should show custom dimensions properties along with the log message.
What is the actual behavior? Application insights log shows only log message.
Additional context. Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Google Analytics Custom Dimension Not Being Set
A dimension is sent along with the either a page view or an event. It won't get sent by itself. So you should...
Read more >[GA4] Custom dimensions and metrics - Analytics Help
If you haven't customized your data collection code, you probably do not need to read this article or use custom dimensions and metrics....
Read more >Custom dimension not working - Planet Minecraft
I have a custom dimension data pack. If a dimension is not showing up there could be many things wrong. Do you have...
Read more >Custom dimension show not-set after 2022/02/08 - Issue Tracker
js to log custom dimensions the "field-X" were logged as user-scope dimension. Everything worked perfectly until 2022/02/08. After Feb.08, there are many (not- ......
Read more >How to Set Up GA4 Custom Dimensions 2022 - MeasureSchool
For instance, you want to track an event that is not available in the ... Let's have a look at how scopes of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Izchen alright ! thank you.
I will open a ticket when I can from my admins … ( You don’t have permission to create a support request … )
I’m having the same problem with custom_metric -> https://github.com/census-instrumentation/opencensus-python/pull/820
the dimensions do not show up in azure monitor.
code to reproduce :
If you run this code @lzchen do you see the dimension in azure monitor ?
Thank you