Hi,
The LocalForwarder with OpenCensus is a great feature, it would be interesting to have documented how to log other kinds of objects handled by Application Insights, like: web requests, dependencies, traces. Currently it is not clear, after reading the documentation about LocalForwarder, how to track anything besides events.
Details are hidden behind the "auto-magic" happening inside the context manager (tracer.span). How to generate for example logs for web requests and exceptions?
Finally, it would also be great to have documentation about using LiveStream API directly. It seems that currently the only option is to clone the repository with the .NET SDK and read its source code and inspect network traffic.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Adding @nikmd23 who should be able to help with some of the questions on OpenCensus/Local Forwarder.
@RobertoPrevato on the live metrics front are you looking for documentation like this or something else?
@RobertoPrevato Thank you for the feedback! We've assigned this to the document author so they can update the documentation as appropriate.
Hi @RobertoPrevato,
LocalForwarder is an agent that gets data from ApplicaitonInsights (Java SDK is only supported now) OR OpenCensus and sends them to ApplicationInsights backend.
So you instrument your app with opencensus configure the exporter to the ocagent and get requests, dependencies and logs (span's annotations).
If you are not getting requests and dependencies, please make sure your code or some integrations emitting spans and exporter is configured.
Here are the examples of configuration: https://github.com/Microsoft/ApplicationInsights-LocalForwarder/tree/master/examples/opencensus
You can find examples on how to use opencensus in general here: https://github.com/census-instrumentation (choose repo specific to your language)
There is currently no way to track exceptions with opencensus. We are working on it.
So, cannot use LocalForwarder alone, and the ability to send specific events depends on the tool you choose to instrument your code.
Hi @lmolkova,
Thanks everyone for your quick answers. Before opening my request, I ran the example in MSDN and tried successfully the LocalForwarder with Python like in the example in the documentation. What I meant to say is, that using the provided example, you see only _"Outgoing Requests"_ inside Live Metrics Stream: but what if we wanted to use it for a web server, and see logs for _"Incoming Requests"_, like it happens when configuring the .NET SDK for a web application deployed to Application Service Plan?
My question about documentation on how to use the LiveStream web api directly, is that it would be beautiful to have documentation on how to interact with it (I mean the web methods); so that it would be easier for developers community to contribute creating SDKs for programming languages that are not supported currently (without using OpenCensus). Right now the only way to know how to use LiveStream api, is to read the source code of the official .NET SDK.
@RobertoPrevato I think our MSDN examples lack web-server part. you can find the real example that reports requests here: https://github.com/Microsoft/ApplicationInsights-LocalForwarder/blob/master/examples/opencensus/python-app/app/views.py
This is Django example, but Flask is also instrumented.
If you use something else, please have a look at Django instrumentation https://github.com/census-instrumentation/opencensus-python/blob/master/opencensus/trace/ext/django/middleware.py
you can do something similar in your app.
@tokaplan could you please help with LiveStream questions?
Regarding Live Stream - currently Live Stream API is not public. We have considered making it public at different times, and for variety of reasons chose against it. The plan is to have full support of Live Stream API in OpenCensus SDK eventually, but there is no plan to make Live Stream API publicly available and independently supported.
Thanks, everything is clear!