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

Allow request traceability via distributed tracing #4783

Open
1 of 12 tasks
chadell opened this issue Nov 10, 2023 · 10 comments
Open
1 of 12 tasks

Allow request traceability via distributed tracing #4783

chadell opened this issue Nov 10, 2023 · 10 comments
Labels
type: feature Introduction of new or enhanced functionality to the application

Comments

@chadell
Copy link
Contributor

chadell commented Nov 10, 2023

As ...

Patti - Platform Admin

I want ...

to have more detailed visibility of Nautobot operations to better understand how the different steps in the process of a request are executed.

So that ...

I could understand where in the processing of a request more time is spent, and troubleshoot problems more effectively.

For instance, the OpenTelemetry standard, leveraging Django instrumentation could be a good starting point because it allows easier integration and a standard definition for Traces (and metrics and logs).
A visualization like this could help understand the related interactions of a request:
image

I know this is done when...

Nautobot offers traces for the most significant operations, and also allows other apps in the ecosystem to leverage it.

Optional - Feature groups this request pertains to.

  • Automation
  • Circuits
  • DCIM
  • IPAM
  • Misc (including Data Sources)
  • Organization
  • Plugins (and other Extensibility)
  • Security (Secrets, etc)
  • Image Management
  • UI/UX
  • Documentation
  • Other (not directly a platform feature)

Database Changes

No response

External Dependencies

  • opentelemetry-sdk
  • opentelemetry-instrumentation-django
@chadell chadell added type: feature Introduction of new or enhanced functionality to the application triage This issue is new and has not been reviewed. labels Nov 10, 2023
@gsnider2195 gsnider2195 removed the triage This issue is new and has not been reviewed. label Nov 10, 2023
nrnvgh added a commit to nrnvgh/nautobot that referenced this issue Nov 28, 2023
HanlinMiao added a commit that referenced this issue Nov 29, 2023
Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>
timizuoebideri1 pushed a commit that referenced this issue Dec 8, 2023
Co-authored-by: Hanlin Miao <46973263+HanlinMiao@users.noreply.github.com>
@lampwins
Copy link
Member

lampwins commented Jan 10, 2024

I think you are posing this request in terms of tracing a flow within Nautobot/Job/etc. I would also like to consider this in the context of Nautobot participating in a larger distributed system/workflow. I.e. another system creates some data in Nautobot and provides a trace/span ID for tracking.

@chadell
Copy link
Contributor Author

chadell commented Jan 16, 2024

Yes, I agree. My proposal was about the big picture (including the Nautobot internal one)

@chadell
Copy link
Contributor Author

chadell commented Jan 18, 2024

Yes, that's exactly it.

@gsnider2195
Copy link
Contributor

How much of this request would be covered by #5169? Or is this simply requesting that some type of identifier can be provided in web requests and Nautobot retains that identifier throughout the request's lifetime?

@chadell
Copy link
Contributor Author

chadell commented Jan 31, 2024

It is about taking and identifier and pass through other intergations to create an end-to-end traceability

@gsnider2195
Copy link
Contributor

@chadell would this be a sufficient definition of done for this issue?

  • Nautobot is able to accept an arbitrary identifier in an HTTP request
  • Nautobot displays that identifier in all logging messages
  • Any ObjectChange instances created by this request will store the identifier
  • All API responses include this identifier?
  • All UI responses include this identifier in an html comment?

@lampwins
Copy link
Member

https://github.com/open-telemetry/opentelemetry-python-contrib

@chadell
Copy link
Contributor Author

chadell commented Feb 15, 2024

Yes, this is what I had in mind as a potential solution, OpenTelemetry.
AFAIK, @nlgotz has been exploring it.

@nlgotz
Copy link
Contributor

nlgotz commented Feb 15, 2024

I started testing adding in OpenTelemetry in #5295 mainly to get more familiar with Tempo/tracing.

There's still a lot of work/testing needed before it's ready though. The PR so far has the ability to do a trace for normal page views and also running a job. The job run shows everything related to Django, Celery, Postgres, and Redis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of new or enhanced functionality to the application
Projects
No open projects
Status: To Groom
Development

No branches or pull requests

5 participants