Skip to content

feat(trace): add explicit span emission helpers - #49

Merged
ahmadki merged 1 commit into
mainfrom
rhewett/pr2-span-utilities
Sep 4, 2026
Merged

feat(trace): add explicit span emission helpers#49
ahmadki merged 1 commit into
mainfrom
rhewett/pr2-span-utilities

Conversation

@rhewett-nv

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds explicit timestamp span utilities for emitting completed spans and deriving Linux process start time without expanding the top-level Lens API.

Issues

N/A

Usage

import time

from opentelemetry import trace

from nemo.lens.span_utilities import emit_span, linux_process_create_time

tracer = trace.get_tracer("nv.dl.launch")

process_start = linux_process_create_time()
workload_start = time.time()

emit_span(
    tracer,
    "nv.dl.launch.container_load",
    process_start,
    workload_start,
    attributes={"example.phase": "startup"},
)

Before your PR is "Ready for review"

Pre checks:

  • I read the Contributor guidelines.
  • All commits are signed off (git commit -s) per the DCO.
  • I added or updated tests under tests/ for any behavior change.
  • I ran pytest and pre-commit run --all-files locally; both pass.
  • I updated docs/ and README.md where behavior, configuration, or public API changed.
  • If this changes a lens public API symbol, I updated the cross-repo _fallbacks.py files in Megatron-LM / RL / Gym.

Additional information

Validation on pr2-span-utilities:

  • ../.venv/bin/pre-commit run --all-files: passed
  • PYTHONPATH=src ../.venv/bin/python -m pytest -q: 247 passed, 7 warnings
  • ../.venv/bin/python -m compileall -q src tests: passed
  • npm --prefix docs/fern run check: passed with 0 errors; one warning because the unauthenticated redirects check is skipped without fern login / FERN_TOKEN

Notes:

  • PR2 is one signed commit: 1828ae4 feat(trace): add explicit span emission helpers.
  • It adds src/nemo/lens/span_utilities.py and tests/test_span_utilities.py.
  • It does not add top-level nemo.lens exports.
  • It adds no opentelemetry.sdk imports under src/; SDK usage is test-only.
  • No cross-repo fallback update is required because this does not expand the fallback surface.

@rhewett-nv
rhewett-nv requested a review from ahmadki as a code owner August 30, 2026 23:53
@copy-pr-bot

copy-pr-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ahmadki

ahmadki commented Sep 3, 2026

Copy link
Copy Markdown
Member

/ok to test 1828ae4

ahmadki
ahmadki previously approved these changes Sep 3, 2026
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr2-span-utilities branch from 1828ae4 to 96494a2 Compare September 3, 2026 18:31
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr2-span-utilities branch from 96494a2 to 0890293 Compare September 3, 2026 18:47
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr2-span-utilities branch 2 times, most recently from 3b89e45 to 401774f Compare September 3, 2026 19:28
@rhewett-nv
rhewett-nv force-pushed the rhewett/pr2-span-utilities branch from 401774f to 66d2c09 Compare September 4, 2026 00:30
@ahmadki

ahmadki commented Sep 4, 2026

Copy link
Copy Markdown
Member

/ok to test 66d2c09

@ahmadki
ahmadki disabled the stack merge September 4, 2026 14:15
Base automatically changed from rhewett/pr1-resource-attrs to main September 4, 2026 14:17
Signed-off-by: Russell Hewett <rhewett@nvidia.com>
@ahmadki
ahmadki force-pushed the rhewett/pr2-span-utilities branch from 66d2c09 to 4a9ddcc Compare September 4, 2026 14:17
@ahmadki
ahmadki merged commit 0bd8e16 into main Sep 4, 2026
4 checks passed
@ahmadki
ahmadki deleted the rhewett/pr2-span-utilities branch September 4, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants