microsoft / kiota-java

Java libraries for Kiota-generated API clients.
https://aka.ms/kiota/docs
MIT License
23 stars 24 forks source link

How to avoid Application Insights to be spamed #1446

Closed dwlabcube closed 1 month ago

dwlabcube commented 1 month ago

My App-Insights get filled very soon. Each Request logs about 10 InProcs. How can i disable this?

image

Actually i am using the Java-Agent not an exporter. Some things there can be set via Env-Vars, but unluckily the .._AZURE_SDK_ENABLED being set to false did not solve the issue.

image

i thought there might be another env-var to be set.

the spans get set up in kiota here: https://github.com/microsoft/kiota-java/blob/6f9a3219a543fe30525931339e33bd8ad27ae2f3/components/http/okHttp/src/main/java/com/microsoft/kiota/http/OkHttpRequestAdapter.java#L773

baywet commented 1 month ago

For context this originally was posted here and workarounds were suggested. https://github.com/microsoftgraph/msgraph-sdk-java/issues/2084

@dwlabcube thank for re-opening here. Have you explored the custom exporter option I suggested?

dwlabcube commented 1 month ago

Since I did not find a "Out-of-the-Box" solution for Java i thought i'd rather ask the guys who programmed it. maybe there is already an easy solution that we are just not aware of...

baywet commented 1 month ago

Not today. Those environment variables are used by the agent itself. So the agent would need to define and implement a new one for kiota clients. (might be worth asking them) However it seems that the agent offers a configurable processor which might allow you to mask/exclude the kiota related spans.

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.