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

Id property in telemetry context not submitted #18

Closed
marcelkieser opened this issue Aug 11, 2016 · 0 comments
Closed

Id property in telemetry context not submitted #18

marcelkieser opened this issue Aug 11, 2016 · 0 comments

Comments

@marcelkieser
Copy link

In the documentation you set up the telemetry context in the following way and pass an id to the application object:

from applicationinsights import TelemetryClient
tc = TelemetryClient('<YOUR INSTRUMENTATION KEY GOES HERE>')
tc.context.application.id = 'My application'
tc.context.application.ver = '1.2.3'

But as only defined keys are written in the Utils._write_complex_object(...) method and the id property is not defined there it will not be transmitted:

class Application(object):
    """Data contract class for type Application.
    """
    _defaults = collections.OrderedDict([
        ('ai.application.ver', None)
    ])
...
   def write(self):
        """Writes the contents of this object and returns the content as a dict object.

        Returns:
            (dict). the object that represents the same data as the current instance.
        """
        return _write_complex_object(self._defaults, self._values)
...
def _write_complex_object(defaults, values):
    output = collections.OrderedDict()
    for key in defaults.keys():
        default = defaults[key]
        if key in values:

Is the documentation wrong or is the id property missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants