microsoft / ApplicationInsights-Java

Application Insights for Java
http://aka.ms/application-insights
Other
296 stars 199 forks source link

SFTP dependency tree not available with applicationinsights-agent-3.5.2 #3697

Closed abhikt48 closed 5 months ago

abhikt48 commented 6 months ago

Expected behavior

Dependency tree should be available with SFTP. Does applicationinsights-agent supports SFTP ?

Actual behavior

Dependency tree is not populating with SFTP transport.

To Reproduce

Refer mule4-ai-sftp-test

System information

Please provide the following information:

Logs

Refer applicationinsights.log

jeanbisutti commented 5 months ago

SFTP dependencies are not automatically collected : https://learn.microsoft.com/azure/azure-monitor/app/opentelemetry-add-modify?tabs=java

See https://opentelemetry.io/docs/languages/java/instrumentation/ for manual instrumentation

abhikt48 commented 5 months ago

@jeanbisutti, thank you for the details. We are using the MuleSoft library to connect to SFTP servers, and we are unable to modify its codebase.

It seems that manual instrumentation is only possible if the library code can be modified, allowing us to initialize OpenTelemetry settings to enable SFTP logging.

Is this correct? Or do we have any other options to initialize OpenTelemetry outside of the SFTP connector library?

abhikt48 commented 5 months ago

@jeanbisutti One more point to add in above question,

  1. As We are using codeless agent, Can we use this manual setup in conjunction with codeless agent ?
  2. Is it correct that manual instrumentation is only possible if the library code can be modified, allowing us to initialize OpenTelemetry settings to enable SFTP logging?
jeanbisutti commented 5 months ago

@abhikt48

SFTP calls are not instrumented by the Java agent: https://learn.microsoft.com/azure/azure-monitor/app/opentelemetry-add-modify?tabs=java

You could use the Java agent and create spans for each SFTP call from your application code: https://opentelemetry.io/docs/languages/java/instrumentation/#create-spans

The tracer can be retrieved from GlobalOpenTelemetry:

import io.opentelemetry.api.GlobalOpenTelemetry;
Tracer tracer = GlobalOpenTelemetry.getTracer("instrumentation-scope-name", "instrumentation-scope-version");

https://central.sonatype.com/artifact/io.opentelemetry/opentelemetry-api

microsoft-github-policy-service[bot] commented 5 months 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 7 days. It will be closed if no further activity occurs within 7 days of this comment.