Closed tskimmett closed 1 week ago
Are you talking about spans and metrics?
I am declaring the fdb resources in the AppHost like this, and I can control the tracing options for all processes that will reference this resource.
var fdb = builder
.AddFoundationDb("fdb", apiVersion: 720, root: "/Sandbox/HelloWorld", clusterVersion: "7.3.54", rollForward: FdbVersionPolicy.Exact)
.WithDefaults(timeout: TimeSpan.FromSeconds(15), retryLimit: 10, tracing: FdbTracingOptions.All)
.WithLifetime(ContainerLifetime.Persistent)
;
The call to WithDefaults(...., tracing: FdbTracingOptions.All)
changes the default tracing options to include more detailed spans and metrics, but with Default
you should already see some entries. With this, I can see spans in the dashboard:
As well as metrics:
For both Metrics and Activities, the source name is FoundationDB.Client
and you may have to change the log level in you appsettings.json file, depending on the logging library that you are using (Serilog? default .NET implementation?)
I looked in the ServiceDefaults and appsettings.json I am using, and did not see any other particular settings.
Yeah, spans and metrics. The main difference I see on my end is that I specified api version 730 and I'm using an ARM-based fdb docker image. I'll play around with that. Thanks for the quick response!
the API level could be anything else, like 710 or 720. Are you on macOS on M3/M4 ? The current version published in NuGet does not correctly load libfdb_c on macOS (it looks for libfbd_c.so
instead of libfdb_c.dylib
which is fixed in the main branch).
Also, please note that the official docker images published on dockerhub by Apple usually come in pairs, with odd and even numbered version, which are built with and without AVX (I'm not sure why they do it that way??). The odd versions with AVX will not run on Docker Desktop on macOS, you have to select an even numbered version (like 7.3.54
instead of 7.3.55
).
If everything starts correctly, you should see in the Aspire Dashboard that the fdb cluster resource is running. Then of course, you have to execute some fdb queries from your other process to see the logs/spans.
I have not yet done the work to send the telemetry from the fdb cluster itself via OpenTelemetry. I known this is supported by fdbserver
via some environment variable, but I was not able to make it run previously.
For spans and metrics from the fdb .NET Client, they should be sent, unless you have some settings that set the log level to Warning/Error by default? The namespace of the client code is "FoundationDB.Client", (I'm not sure if this is case sensitive by the way!).
Yeah, the fdb container is running fine and I have a simple console application to do some basic benchmarking of reads/writes.
Could share the code of your AppHost and the relevant parts of the console app?
Turns out it was just because I wasn't calling app.StartAsync()
with my console app setup. Thanks for all the info. I'll go ahead and close this issue.
So far this project looks great and the actual FDB interaction is working perfectly. My only question is about how to get open telemetry working. As far as I can tell, tracing and metrics are enabled on the db client by default, but I'm not seeing anything in the aspire dashboard. I also noticed that individual transactions had null
Log
properties. I'm guessing I've just misconfigured something.