Skip to content

Define VCS span semantic conventions (fixes #3767)#3793

Open
Dipanshusinghh wants to merge 16 commits into
open-telemetry:mainfrom
Dipanshusinghh:vcs-span-conventions
Open

Define VCS span semantic conventions (fixes #3767)#3793
Dipanshusinghh wants to merge 16 commits into
open-telemetry:mainfrom
Dipanshusinghh:vcs-span-conventions

Conversation

@Dipanshusinghh

Copy link
Copy Markdown
Contributor

Closes #3767
This PR defines span conventions for VCS operations as discussed in the issue.
Changes:

model/vcs/registry.yaml - Added vcs.action enum attribute with standard members: clone, fetch, pull, push, checkout.
model/vcs/spans.yaml (new) - Defined VCS span conventions:

Span name pattern: {vcs.action} {vcs.repository.name} (e.g. clone semantic-conventions)
Required attributes: vcs.action, vcs.repository.name
Recommended attributes: server.address, server.port, vcs.ref.head.name, vcs.ref.head.revision, vcs.ref.type, error.type

Cross-VCS naming research - Added a note documenting how the canonical actions (clone, fetch, pull, push, checkout) map to equivalent concepts in SVN, Mercurial, and Perforce, confirming these names are generic and not git-specific.
Span hierarchy guidance - Documented the expected nesting:

VCS spans are child spans of CI/CD pipeline task/step spans (e.g. a "checkout code" step)
HTTP/RPC client spans (underlying network calls) are child spans of the VCS span

.chloggen/define-vcs-span-conventions.yaml - Added changelog entry (type: enhancement, component: vcs).

All changes formatted via prettier and pass the repo's check script.

@Dipanshusinghh

Dipanshusinghh commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@kamphaus opened PR #3793 for this It covers:

vcs.action enum (clone, fetch, pull, push, checkout)
Span name pattern {vcs.action} {vcs.repository.name} per the convention guidelines
Mapping of these actions to SVN, Mercurial, and Perforce equivalents (per your question on whether these r git-specific)
Span hierarchy: VCS span as child of CI/CD pipeline task span, with HTTP/RPC spans as children of the VCS span

Starting at development stability as discussed. Would appreciate a review whenever you have time.!

Comment thread model/vcs/spans.yaml Outdated
Comment thread .markdownlint-cli2.yaml Outdated
Comment thread model/vcs/spans.yaml Outdated
Comment thread model/vcs/spans.yaml Outdated
Comment thread model/vcs/spans.yaml Outdated
Comment thread docs/vcs/vcs-spans.md Outdated
@kamphaus kamphaus moved this to In Progress in CI/CD SemConv: Phase 2 Jun 14, 2026
@kamphaus kamphaus moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Jun 14, 2026
- Move action generic mapping to notes on the enum members in registry.yaml
- Remove fallback span name format since repository.name is required
- Revert unrelated formatting change in .markdownlint-cli2.yaml
- Add docs/vcs/README.md and reference it in docs/README.md
- Regenerate registry docs using weaver
As decided in the CI/CD SIG meeting on June 16, merge VCS spans under CI/CD section to maintain consistency.
- Integrate VCS spans placeholder into docs/cicd/cicd-spans.md
- Delete docs/vcs directory
- Revert top-level VCS link in docs/README.md
- Regenerate registry docs using weaver
Comment thread docs/cicd/cicd-spans.md
Comment thread docs/cicd/cicd-spans.md Outdated
Comment thread model/vcs/spans.yaml Outdated
…evel-2 heading

- Merge in latest main branch changes
- Change status in cicd-spans.md from Release Candidate to Mixed
- Change VCS client span heading from level-3 to level-2
- Update Table of Contents using doctoc
Comment thread docs/cicd/cicd-spans.md Outdated

**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span).

The span name SHOULD be `{vcs.action} {vcs.repository.name}`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning behind including repository name in the span name?

Concerns:

  • non-normalized repository names
  • length of repository names
  • mix of characters separating words (ie. run-build MY_Repository-name)
  • Loss of queue/exec in the span name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New question:

What would actually emit a 'VCS' Span? Is there any prototype that exists today for this? I'm struggling to think of what in a VCS repository would create a span associated with a CI/CD pipeline that isn't part of the CI/CD pipeline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spec's hierarchy note covers this — VCS span is emitted by the instrumentation inside a pipeline step that runs a git operation (clone, checkout etc). Think of a "Checkout Code" step in GitHub Actions — that step's instrumentation would emit this CLIENT span. It's not a VCS-side concern, it lives within the CI/CD pipeline.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adrielp
Agred, changing span name to just {vcs.action} makes sense vcs.repository.name is already captured as a required attribute so no information is lost

@kamphaus kamphaus Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The span name {vcs.action} {vcs.repository.name} follows the span naming guidance {action} {target}.
For example HTTP spans follow this: GET /orders/{id}.

non-normalized repository names

Since the {vcs.repository.name} attribute already existed, is this currently an issue where it's used?
Should we create a follow-up issue for this?

length of repository names

Should we define a length limit and fallback to just {vcs.action} as span name if exceeded?

mix of characters separating words (ie. run-build MY_Repository-name)
Loss of queue/exec in the span name.

I don't follow this. Given the space in the span name and span hierarchy guidance the task span and vcs span would appropriately separate these concerns.

What would actually emit a 'VCS' Span?

Either the git CLI when Otlp env vars are set could emit such spans or any CI/CD system could emit them (eg. when a checkout step or actions/checkout action is executed).

I'm struggling to think of what in a VCS repository would create a span associated with a CI/CD pipeline that isn't part of the CI/CD pipeline.

As noted we have only defined the client span for use in CI/CD systems or in CLI tools.
We could think of defining corresponding server spans for use VCS-side.
Do you think we should the server span as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnks for the clarification @kamphaus!
I agree with keeping {vcs.action} {vcs.repository.name} as it aligns with the {action} {target} spec guidelines. Regarding the prototype — is it required to unblock this PR given we're at development stability?

This comment was marked as duplicate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed the requirement for a protype in the general SemConv SIG and CICD SIG meetings.
We should have one for the VCS span conventions.

Ideally the prototype would be for the git CLI tool (for a prototype a fork is sufficient, it does not need to be merged).
I found this prior art around git cli OpenTelemetry: https://github.blog/engineering/architecture-optimization/measuring-git-performance-with-opentelemetry/
Maybe https://github.com/git-ecosystem/trace2receiver could be adapted to emit VCS spans.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dipanshusinghh did you have a chance to work on the prototype? It seems to be the main blocker. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

havent had time for the prototype yet what's the simplest way to unblock this? would a simple sdk script emitting these spans work , or does it have to be git cli integration?

Comment thread model/vcs/spans.yaml Outdated
Comment on lines +13 to +15
**Span Hierarchy:**
When integrated into CI/CD pipelines, VCS spans SHOULD be modeled as child spans of the CI/CD pipeline task/step execution spans (e.g., a task span representing a "checkout code" step).
Any underlying HTTP client or RPC spans representing the actual network communication with the VCS server/provider SHOULD be modeled as child spans of the VCS span.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible to control span hierarchy in practice, especially when they come from different instrumentations. The hierarchy depends fully on the caller implementation and set of enabled instrumentations.

Suggested change
**Span Hierarchy:**
When integrated into CI/CD pipelines, VCS spans SHOULD be modeled as child spans of the CI/CD pipeline task/step execution spans (e.g., a task span representing a "checkout code" step).
Any underlying HTTP client or RPC spans representing the actual network communication with the VCS server/provider SHOULD be modeled as child spans of the VCS span.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, removed span hierarchy notes completely

Comment thread model/vcs/spans.yaml
requirement_level: recommended
- ref: vcs.ref.type
requirement_level: recommended
- ref: server.address

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server address of what? Please update brief or note to explain what the endpoint is

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated brief it means the vcs provider host like github.com

Comment thread model/vcs/spans.yaml Outdated
span_kind: client
stability: development
brief: >
This span describes a Version Control System (VCS) operation client.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the VCS operation client ? If it's a library, do we ask CI/CD pipelines to enable instrumentation? if it's a CLI, do we want them to be instrumented natively?

This goes back to the prototypes discussion in another comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added note to spans.yaml, client spans are mostly from cicd tasks (clone/checkout) or git cli wrapper tools

Comment thread model/vcs/spans.yaml Outdated
note: |
**Span name** MUST follow the overall [guidelines for span names](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span).

The span name SHOULD be `{vcs.action} {vcs.repository.name}`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name may depend on the operation.

E.g. you clone a repo, so name is clone my-repo, but you can pull a branch and then name would be pull my-branch or pull my-repo my-branch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make naming guide more flexible. so now it can be operation + repo name or operation _+ branch depending on operation

Comment thread model/vcs/registry.yaml Outdated
"gitea",
"bitbucket",
]
- id: vcs.action

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a strong opinion, in other conventions we call these things *.operation.name and usually we end up relaxing enum so that individual systems use their own terminology.

E.g. perforce users would appreciate seeing the command that was actually called (like sync) instead of unified version.

The unification would come through two options:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed it to vcs.operation.name & changed type to string now tools can use their own names like sync or update

@github-project-automation github-project-automation Bot moved this from Awaiting codeowners approval to Blocked in Semantic Conventions Triage Jul 5, 2026
@Dipanshusinghh
Dipanshusinghh requested review from a team as code owners July 5, 2026 17:54
@Dipanshusinghh
Dipanshusinghh requested a review from lmolkova July 6, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:vcs enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Define VCS span conventions

5 participants