[swift][osprofiler][telemetry] What is the current state of tracing for Swift?
Hello, There is no OSProfiler for Swift, right? Is someone developing it? Is there anything related to OpenTelemetry in the context of Swift? I need to know the entire path of a request, how much time is spent in each middleware, every call to external APIs made by middlewares, which proxy was used, and which storage nodes were utilized. The best I have so far is to instrument the parts that interest me with Jaeger, simply because we already use it for other services. -- _‘Esta mensagem é direcionada apenas para os endereços constantes no cabeçalho inicial. Se você não está listado nos endereços constantes no cabeçalho, pedimos-lhe que desconsidere completamente o conteúdo dessa mensagem e cuja cópia, encaminhamento e/ou execução das ações citadas estão imediatamente anuladas e proibidas’._ * **‘Apesar do Magazine Luiza tomar todas as precauções razoáveis para assegurar que nenhum vírus esteja presente nesse e-mail, a empresa não poderá aceitar a responsabilidade por quaisquer perdas ou danos causados por esse e-mail ou por seus anexos’.*
As far as I know, there is no official OSProfiler for Swift yet, but there are some projects that aim to provide similar functionality. For example, slashmo has created a project called swift-otel5, which builds on top of Swift Distributed Tracing by implementing its instrumentation and tracing API. https://github.com/slashmo/swift-otel This means that any library instrumented using Swift Distributed Tracing will automatically work with swift-otel. OpenTelemetry Swift provides a set of APIs and SDKs for instrumenting and collecting telemetry data from Swift applications. It supports tracing, metrics, and logging, as well as integration with popular frameworks and libraries such as Alamofire, Vapor, GRPC, and NIO. You can use OpenTelemetry Swift to monitor the performance, reliability, and behavior of your Swift applications, and export the data to various backends such as Jaeger, Zipkin, Prometheus, or any other compatible OpenTelemetry collector. Another way to implement tracing in Swift is to use OSProfiler, which is a library for cross-project profiling that is used by most OpenStack projects and their python clients. It provides functionality to generate one trace per request, that goes through all involved services. Thats why OSProfiler is not yet available for Swift natively, but there are some projects that aim to provide similar functionality. Kerem Çeliker tr.linkedin.com/in/keremceliker
While reading your response, I realized that my question was a bit unclear. I was referring to OpenStack Object Storage 'Swift', which is why I asked about OSProfiler. I mention this because it got confusing since I mentioned OpenTelemetry. I came across the association between OpenTelemetry and the Swift programming language while researching and ended up including that in my question. Just to clarify, I want to do tracing of OpenStack Swift. Sorry for the confusion.
To the best of my knowledge, swift does not support profiling using osprofiler, but has its own profiler middleware[1], which stores profile data at in a local data file and expose it via an additional endpoint path. If you are looking for a specific integration with Jaeger then you may need to extend the middleware to send metrics to Jaeger (or create a different middleware using osprofiler or any other libraries). Swift also supports gathering metrics using the recon middleware or statsd[2] but this might not be very useful for your use case because it does not provide any view about tracing. [1] https://docs.openstack.org/swift/latest/middleware.html#module-swift.common.... [2] On 12/22/23 05:34, Matheus Victorello wrote:
Hello,
There is no OSProfiler for Swift, right? Is someone developing it? Is there anything related to OpenTelemetry in the context of Swift?
I need to know the entire path of a request, how much time is spent in each middleware, every call to external APIs made by middlewares, which proxy was used, and which storage nodes were utilized.
The best I have so far is to instrument the parts that interest me with Jaeger, simply because we already use it for other services.
On Thu, 21 Dec 2023 17:34:58 -0300 Matheus Victorello <m.victorello@luizalabs.com> wrote:
Is there anything related to OpenTelemetry in the context of Swift?
Take a look at this review: https://review.opendev.org/c/openstack/swift/+/857559 Also https://etherpad.opendev.org/p/swift-ptg-bobcat#L76 Apparently we weren't talking about tracing at Caracal vPTG. Maybe Matt is too busy with other things. If you can carry this forward, it would help. -- P
participants (5)
-
KEREM CELIKER
-
m.victorello@luizalabs.com
-
Matheus Victorello
-
Pete Zaitcev
-
Takashi Kajinami