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
[Instrumentation.MySqlData] is not working with MySQL.Data 8.0.33 #1157
Comments
@moonheart, could you please check? |
I'll check this now. |
This change was introduced by this large commit mysql/mysql-connector-net@291c2f3, which causes |
Before this commit, the command is executed on a single thread: public Task<int> ExecuteQueryAsync()
{
OpenQuery();
var r = Execute();
CloseQuery();
return Task.FromResult(r);
}
public void OpenQuery()
{
// Activity created here
}
public int Execute()
{
return 1;
}
public void CloseQuery()
{
// Activity can be retrieved from here
} The Activity can be retrieved because it's synchronous, no context switch happened. After this commit, the code is asynchronous all the way through: public async Task<int> ExecuteQueryAsync()
{
await OpenQueryAsync();
var r = await ExecuteAsync();
await CloseQueryAsync();
return r;
}
public async Task OpenQueryAsync()
{
// Activity created here
}
public async Task<int> ExecuteAsync()
{
return 1;
}
public async Task CloseQueryAsync()
{
// Activity can not be retrieved from here
} The Activity can not be retrieved because when it left the I dotn't have a good idea how to work around this yet, maybe someone can help. Or the problem does not exist and my usage is wrong. One workaround is to use https://github.com/pardeike/Harmony to patch the original method and create the Activity in prefix and pass it to postfix. |
Related: open-telemetry/opentelemetry-dotnet#4643 MySql Instrumentation stopped working at MySql.Data@8.0.31. |
Hello @t03apt, I'm sorry for the delayed responses. Have you managed to resolve the issue you mentioned? I couldn't find the repository you posted. Instrumentation should be functional prior to version 8.0.33. Regarding the current issue in version 8.0.33, I have submitted a feature request in the MySQL bug tracker, but it appears that there hasn't been any activity on it yet. |
Hi @moonheart, |
@t03apt Hi, I've reviewed your repository and noticed that the generated connection string,
After adding this option, the instrumentation is working as expected. |
@moonheart Wow. I missed that. Thanks! |
Closing issue per last comment. |
Issue with OpenTelemetry.Instrumentation.MySqlData
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.3.2
):Runtime version (e.g.
net462
,net48
,net6.0
,net7.0
etc. You canfind this information from the
*.csproj
file):Is this a feature request or a bug?
What is the expected behavior?
Activities/Spans created as for 8.0.32.1 version
What is the actual behavior?
No Activities/Span.
Just execute application test from Kielek/opentelemetry-dotnet-instrumentation@95c191b with mysql avaialbe for port 3306.
It can be used to test also with older versions by modyfying csproj.
Additional Context
Found by open-telemetry/opentelemetry-dotnet-instrumentation#2478
The text was updated successfully, but these errors were encountered: