question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data not sent to App Insights when run on Docker

See original GitHub issue

When running a Python module on Docker while using the Azure Monitor metrics exporter, I get an SSL error, and no data is sent to App Insights. When running the module locally, the data gets sent just fine. Not sure if it’s related to this Python issue, but the workaround listed there didn’t work for me.

This is the main function of the code I’m running:

def main():
    RUNTIME_MEASURE = measure_module.MeasureFloat("runtime", "Test runtime", "seconds")
    RUNTIME_VIEW = view_module.View("runtime_view", "Test runtime", [], RUNTIME_MEASURE, aggregation_module.LastValueAggregation())

    exporter = metrics_exporter.new_metrics_exporter(export_interval=0.5, instrumentation_key=APPINSIGHTS_INSTRUMENTATIONKEY)
    view_manager.register_exporter(exporter)

    view_manager.register_view(RUNTIME_VIEW)
    mmap = stats_recorder.new_measurement_map()
    tmap = tag_map_module.TagMap()


    """Generate the HLD for the cluster."""
    args = parse_args(sys.argv[1:])

    start_time = default_timer()

    # Generates HLD and manifests directory.
    hydrator = HLD_Generator(args)
    hydrator.generate()

    runtime = default_timer() - start_time
    mmap.measure_float_put(RUNTIME_MEASURE, runtime)
    mmap.record(tmap)
    time.sleep(0.5)
    print(f"Hydrate runtime: {runtime}")

This is the output I get after running docker run (SSL errors, followed by the normal output of the module, followed by more SSL errors):

docker run -v /c/Users/t-maliao/Downloads/config:/config -v /c/Users/t-maliao:/app/out hydrate.azurecr.io/hydrate:test -k /config -n hi -d -v -t

Transient client side error HTTPSConnectionPool(host='dc.services.visualstudio.com', port=443): Max retries exceeded with url: /v2/track (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)).
Transient client side error HTTPSConnectionPool(host='dc.services.visualstudio.com', port=443): Max retries exceeded with url: /v2/track (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)).
Transient client side error HTTPSConnectionPool(host='dc.services.visualstudio.com', port=443): Max retries exceeded with url: /v2/track (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)).

< normal output from the module (deleted for the sake of conciseness) >


Transient client side error HTTPSConnectionPool(host='dc.services.visualstudio.com', port=443): Max retries exceeded with url: /v2/track (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)).
Hydrate runtime: 1.8845756000373513

Any insight into this issue would be much appreciated! Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
frsanncommented, Oct 16, 2019

The same error, but I think I figured it out myself. I’m using PiHole Firewall on home network, and disabling it seem to have helped.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Insights Docker "Error retrieving data" in Portal
Application Insights for Docker currently has a UI bug when sending Docker telemetry for AI application for the first time.
Read more >
Troubleshoot no data in Application Insights for .NET - Azure
In Visual Studio Solution Explorer, right-click the project and select Application Insights > Configure. Reset the app to send telemetry to the ...
Read more >
Logging to Azure Application Insights from .NET Core 2 ...
Logging to Azure Application Insights from .NET Core 2 running in a Docker Container (or Azure webapp) · Add the environment variable in...
Read more >
Monitoring windows docker containers using Application ...
If you onboarded Azure AppInsights successfully you shall be able to see your live container under Live Metric Stream . It will show...
Read more >
Troubleshooting Container Insights - Amazon CloudWatch
If your deployment fails with the error Unauthorized panic: Cannot retrieve cadvisor data from kubelet , your kubelet might not have Webhook authorization...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found