-
Notifications
You must be signed in to change notification settings - Fork 196
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
Is there a way to sample overrides EventHub messages and send events? #3147
Comments
Hi @pdefreitas can you follow this doc: this is how you find out the dependency attributes in the debug self-diagnostics logs: Alternatively, you can submit a sample app at https://github.com/microsoft/ApplicationInsights-Java-Repros, and then I can add code to demonstrate how to apply sampling overrides on your app. |
@heyams The exporting span logs was described in the alternatives I've considered. You can find here two examples for
I've tried the following sampling overrides:
And it still exports the spans above and dependency appears on AppInsights. |
can you try this {
"connectionString": "...",
"preview": {
"sampling": {
"overrides": [
{
"telemetryType": "dependency",
"attributes": [
{
"key": "az.namespace",
"value": "Microsoft.EventHub",
"matchType": "strict"
},
{
"key": "peer.address",
"value": "*.servicebus.windows.net",
"matchType": "regexp"
}
],
"percentage": 0
}
]
}
}
} here are your attributes: attributes={
applicationinsights.internal.item_count=1,
az.namespace="Microsoft.EventHub",
message_bus.destination="REDACTED",
peer.address="REDACTED.servicebus.windows.net",
thread.id=96
}, |
@heyams it seems your proposed solution generates an invalid configuration:
So I've tried the following configuration, which still exports EventHub spans. Note that I've tried to filter through
|
@pdefreitas can you submit a repro sample app to https://github.com/microsoft/ApplicationInsights-Java-Repros? |
@heyams I'm afraid that won't be possible with exact same parameters. What I can state is that we're using Spring Framework with the package |
@pdefreitas i want to see how the exception is generated. a simple app can be done right? you can remove all the credentials after testing. then i can fill in my own resources. |
@heyams what do you mean by exception? I'm trying to do sampling override on a dependency. |
@pdefreitas sorry, got mixed up on another github issue. { this config is good. but sampling overrides still didn't work for you. if you provide a sample app, it will be helpful and quicker. |
@heyams repro posted here: https://github.com/pdefreitas/ApplicationInsights-Java-Repros It's so trivial and with microsoft components that I did not expect that I would have to do such a repro 👀 |
@pdefreitas thanks! I have lots of issues and other priorities to go through. anything that you can contribute to help me speed up the process is appreciated. |
@heyams the server is running in port 9001, tested with java 8 and java 11 on linux, check |
@pdefreitas I'm getting this exception: any ideas? i didn't find any attributes in the log for "peer.address" and "az.namespace". |
additionally, getting this
|
@heyams For EventHub connection string for this demo, I'm using Connection string–primary key which starts with The REST part I've left the same of the repro. It is a |
@heyams commands to I've used to build and run
Doing the endpoint request:
Logs are stored in
With newer versions of |
@pdefreitas i'm not able to repro your issue microsoft/ApplicationInsights-Java-Repros#5 i only found one dependency associated with the request. your app didn't work for me. so i changed the |
@heyams Probably due to the A&A differences between the two demos. Check my message above, for some reason the latest
My repro is still exporting with |
does it imply that if you use the latest the |
@heyams I would say that not having spans after the upgrade is itself a bug? If someone wants to track these dependencies they're not able to do that anymore. If #3084 is fixed (3.4.9 -> 3.4.10), we might have this issue again because from my new tests with downgraded Application Insights:
With Application Insights |
I will work on #3084 to see if i can repro it. |
#3084 is resolved. Do you want to try it again and let me know if i can close this issue? |
@heyams thanks for following up, this situation seems to be fixed for now! |
Is your feature request related to a problem? Please describe.
I've tried to do sample override for EventHub messages but I wasn't able to do so. I can't find any documentation example allowing me to do so. I've tried attributes like
messaging.system
strict toeventhubs
andservicebus
, and evennet.peer.name
strict targetting the eventhub connection string hostname in question.Describe the solution you would like
Users would be able to do sample overrides for EventHub dependencies.
Describe alternatives you have considered
I've considering using different fields to filter the dependency like az.namespace strict to
Microsoft.EventHub
. I've collected available attributes from the debug log but they don't seem to work for this telemetry type.Additional context
I'm using AppInsights Java 3.4.12.
The text was updated successfully, but these errors were encountered: