Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration to disable specific dependencies #1294

Closed
martupeppe opened this issue Jul 29, 2020 · 33 comments · Fixed by #1418 or #1420
Closed

Configuration to disable specific dependencies #1294

martupeppe opened this issue Jul 29, 2020 · 33 comments · Fixed by #1418 or #1420
Milestone

Comments

@martupeppe
Copy link

Hi,
I just configured my Java application on-prem installing the Java Codeless Agent applicationinsights-agent-3.0.0-PREVIEW.5.jar.

I figured out my application is logging milions of dependencies and I would like to disable them, but I think there is no way to disable only dependencies because as far as I understood the dependencies are auto-tracked.

I would like to have a dedicated configuration to avoid to send dependencies to Application Insights.

Thanks,
Giuseppe

@MS-jgol
Copy link

MS-jgol commented Jul 30, 2020

@martupeppe
Here are the configuration options we have available for Java agent:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-standalone-config

What dependencies are excessive? You may greatly benefit from enabling sampling.

@martupeppe
Copy link
Author

Hi,
Thanks for the Answer I knew that link and it seems there is no way to limit the jdbc dependencies which are causing cost issues.

Thanks

@MS-jgol
Copy link

MS-jgol commented Jul 30, 2020

@martupeppe Do you think sampling may work for you?

@martupeppe
Copy link
Author

No I don't think so. The customer would like to have all the requests.

Another solution would be avoid to send requests from a specific operationname so that the related dependencies would be filtered out.

Any suggestion?

Giuseppe

@martupeppe
Copy link
Author

@MS-jgol any suggestion?

@martupeppe
Copy link
Author

@MS-jgol no ideas? Should I switch to java sdk to disable dependencies?

@martupeppe
Copy link
Author

@MS-jgol looking at the code I think it should be fine amending te BeforeAgentInstaller.java to read the configuration e set a Global Property. In order to avoid to send dependency telemetry, the ByteCodeUtilImpl.java file should be changed and specifically the method trackDependency should evaluate the Global property previously set and log only if the configuration has been enabled. The same mechanism is used for Sampling just to mange the sampling percentage. Do you think it is feasible?

@MS-jgol
Copy link

MS-jgol commented Sep 11, 2020

@martupeppe
We will add disabling certain dependencies in our GA version, which will be in the first week of November. Hopefully this timeline will work for you.

@MS-jgol MS-jgol added this to the 3.0.0 milestone Sep 11, 2020
@martupeppe
Copy link
Author

martupeppe commented Sep 11, 2020

Hi,
This is a great news.
How it will be possible to disable the dependencies? And what type of dependencies will be disabled?

Thanks

@MS-jgol
Copy link

MS-jgol commented Sep 11, 2020

@martupeppe JDBC dependencies definitely. I do not have an insights in how this will be disabled, most like through configuration, and the idea is to be able to also be disable dependencies that may raise cost concerns.

@martupeppe
Copy link
Author

Thanks!!!!

@trask trask changed the title Dependencies Disabling Configuration to disable specific dependencies Sep 13, 2020
@trask
Copy link
Member

trask commented Oct 25, 2020

hey @martupeppe! can you expand on this part?

Another solution would be avoid to send requests from a specific operationname so that the related dependencies would be filtered out.

@martupeppe
Copy link
Author

Sure... it would be nice if there was configuration where it's possibile to insert a specific url (or regex) to be filrered out and not sent to application insights.

Is it clear enough?

Thanks,
Giuseppe

@trask
Copy link
Member

trask commented Oct 25, 2020

Are these health-check urls? Or just really noisy requests?
Would this solution be better in your scenario compared to disabling jdbc dependencies across all requests?

Thanks!

@martupeppe
Copy link
Author

Disabling JDBC dependencies is what I looked for so it's fine having this option in the next release (do you have an official date?).

The request url filter was an alternative for noisy requests that anyway could be useful anyway (next release?).

Giuseppe

@trask
Copy link
Member

trask commented Oct 25, 2020

Yeah, the use case for url filter, particularly for health checks, is something I've heard from a few folks. But I'm still not completely understanding the use case for disabling jdbc dependencies, which is why I'm curious if the url filter is more applicable for your case, or maybe you can provide more details about your use case?

@martupeppe
Copy link
Author

Disabling the jdbc dependencies comes from the scenario where we enabled the applocation insights codeless agent for a java application exposed over internet. The first day we ingested 80gb with of course high costs. Analizyng the ingested data we have seen that more than the 80% of the data was dependencies. Given we can t disable the dependencies, we currently configured a daily cap and a 25% sampling.

Is the use case clear?

Giuseppe

@trask
Copy link
Member

trask commented Oct 25, 2020

Is the jdbc dependency data not useful? Sampling generally works well to control cost, and with sampling you can still see when there are issues with your application <-> database interactions.

@martupeppe
Copy link
Author

The jdbc data are useful but the business prefers having the full incoming requested hence with no sampling.

Can you confirm the jdbc dependencies can be disabled in the next agent release in november?

Giuseppe

@trask
Copy link
Member

trask commented Oct 26, 2020

Got it, thanks for the details.

Yes, jdbc dependencies will be able to be disabled 👍

@martupeppe
Copy link
Author

Perfect.

Last question.... do you have a release date?

Thanks,
Giuseppe

@MS-jgol
Copy link

MS-jgol commented Oct 26, 2020

@martupeppe The next release is GA - first week of November.
Could you please tell us the name of your company? If you wish, send me an email to jgol@microsoft.com
I would love to also discuss a couple of other potential usecases uf possible.

@martupeppe
Copy link
Author

@MS-jgol could you please use my private email for now (giuseppe.marturano@gmail.com)? I will be changing company in the next month and I prefer to provide you with the new company email. The company where I will be working starting from the 23rd of November is Avanade (you should know it ;) ).

Thanks!

@martupeppe martupeppe reopened this Nov 4, 2020
@martupeppe
Copy link
Author

@trask I just saw the 3.0.0 release has been released but I expected the feature to enable/disable the jdbc dependencies via configuration.

Am I wrong?

Giuseppe

@trask
Copy link
Member

trask commented Nov 8, 2020

Ya sorry just not documented yet, I believe this should work:

{
  "instrumentation": {
    "jdbc": {
      "enabled": false
    }
  }
}

@pistolero38
Copy link

Hi !

we have the same problem as @martupeppe : we want to disable the jdbc and redis logs because our dependencies are too big and the customer obviously wants to lower the costs.

I'm using version 3.0.0 of the agent, I put the same configuration as before:

{
    "sampling": {
        "percentage": 100
    },
    "instrumentation": {
        "logging": {
            "level": "INFO"
        },
        "jdbc": {
                "enabled": false
        }
    },
    "heartbeat": {
        "intervalSeconds: 60
    }
}

But I still see the SQL dependency logs in the AppInsights. What's wrong? If I want to do the same thing to disable the redis logs, what configuration should I set ?

Thanks in advance!

@MS-jgol
Copy link

MS-jgol commented Dec 7, 2020

@pistolero38
Do you want to disable all redis logs?

@pistolero38
Copy link

Yes both redis and SQL dependencies logs

@gunsliver
Copy link

Hi can you also provide the way to disable Kafka?

I think it would be great if there is a way to pass property or environment variable to opentelemerty such as OTEL_TRACE_CLASSES_EXCLUDE or otel.integration.[id].enabled * ota in this case

@trask
Copy link
Member

trask commented Dec 17, 2020

hi @gunsliver, do you want to completely disable kafka telemetry, and distributed trace propagation across kafka?

or is there a specific piece that is generating useless noise? thx

@gunsliver
Copy link

hi @gunsliver, do you want to completely disable kafka telemetry, and distributed trace propagation across kafka?

or is there a specific piece that is generating useless noise? thx

Hey @trask, thanks for super quick response. I am looking forward to completely disable kafka telemetry.

@LumirH
Copy link

LumirH commented Dec 22, 2020

I have the same problem as @pistolero38 -- even though I have disabled JDBC instrumentation using recommended config, I still see a lot of SQL dependency traces such as...

2020-12-22 10:10:47.403Z DEBUG c.m.a.agent.Exporter - exporting span: SpanWrapper{delegate=RecordEventsReadableSpan{traceId=XXXXX, spanId=YYYY, parentSpanId=ZZZZ, name=.....

@LumirH
Copy link

LumirH commented Dec 23, 2020

@trask -- I tested 3.0.1-beta2 -- the fix works well.
Thank you.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants