Share via

Application Map in App insights for Python-based functions

Andrey Baranov 0 Reputation points
2023-09-05T00:16:21.2966667+00:00

We're using a number of Azure Functions (C# and Python based) connected to the same Application Insights instance. C# based functions are displayed nicely on Application Map with all their dependencies, external HTTP calls, etc, but the Python functions aren't, they're just shown as circles with no dependencies (even though they're talking to the same resources). What should I do to get Python function dependencies to show on the Application Map?

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

0 comments No comments

1 answer

Sort by: Most helpful
  1. navba-MSFT 27,620 Reputation points Microsoft Employee Moderator
    2023-09-05T05:51:34.5733333+00:00

    @Andrey Baranov Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I see that your ask is specific to the Python based Azure Function app and monitoring it using Application Map feature of AppInsights.

    As per the application map documentation, for Python, you can use OpenCensus Python telemetry processors.

    def callback_function(envelope):
       envelope.tags['ai.cloud.role'] = 'new_role_name'
    
    # AzureLogHandler
    handler.add_telemetry_processor(callback_function)
    
    # AzureExporter
    exporter.add_telemetry_processor(callback_function)
    

    More Info about analyzing Logs, Tracing, metrics in OpenCensus for Python is here.

    If you want to Enable Azure Monitor OpenTelemetry for .NET, Node.js, Python and Java applications, please follow the steps mention here for Python.

    If you intend to use Live metrics in Azure Monitor, then Our docs says that Live Metrics is currently supported for ASP.NET, ASP.NET Core, Azure Functions, Java, and Node.js apps. And its not available for Python.

    Hope this answers.

    **
    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.