Skip to content

Add OpenTelemetry CI/CD semantic conventions support#2863

Merged
plengauer merged 38 commits intomainfrom
copilot/conform-opentelemetry-semantic
Feb 9, 2026
Merged

Add OpenTelemetry CI/CD semantic conventions support#2863
plengauer merged 38 commits intomainfrom
copilot/conform-opentelemetry-semantic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 31, 2026

OpenTelemetry CI/CD Semantic Conventions Conformance ✅

This PR implements comprehensive support for OpenTelemetry CI/CD semantic conventions across all instrumentation levels.

Implementation Completed

  • Analyze current instrumentation structure
  • Update workflow-level instrumentation (actions/instrument/workflow/main.sh)
    • Add cicd.pipeline.* attributes alongside github.actions.* attributes
    • Add new metrics: cicd.pipeline.run.duration, cicd.pipeline.run.errors
    • Map workflow name to cicd.pipeline.name
    • Map conclusion to cicd.pipeline.result with proper values
    • Add helper function to map GitHub conclusion to CI/CD result
    • Use correct state value (finalizing) for completed workflows
    • Remove github.* attributes from cicd metric datapoints (keep only cicd.* on metrics)
  • Update checksuite-level instrumentation (actions/instrument/checksuite/main.sh)
    • Add cicd.* attributes where applicable
    • Add cicd.pipeline.run.duration metric
    • Map check suite name to cicd.pipeline.name
    • Use correct state value (finalizing) for completed check suites
    • Remove github.* attributes from cicd metric datapoints
    • Remove cicd.* attributes from spans (keep only on metrics)
  • Update job-level instrumentation (actions/instrument/job/inject_and_init.sh)
    • Add cicd.* attributes (pipeline.name, task.name, task.type)
  • Create repository-level instrumentation (NEW)
    • Create new directory: actions/instrument/repository/
    • Create main.sh for repository metrics collection
    • Implement VCS metrics (all from semantic conventions):
      • vcs.contributor.count (contributor metrics)
      • vcs.ref.count (branches/tags count)
      • vcs.change.count (PRs/issues count by state)
      • vcs.change.time_to_merge (PR merge time)
    • Support multiple event triggers (issues, pull_request, schedule, workflow_dispatch)
    • Create action.yml for the repository instrumentation
    • Add main.js redirect (following checksuite pattern)
    • Add token and cache inputs
    • Simplify control flow (remove nested if-else)
  • Update deployment workflow (actions/instrument/deploy/action.yml)
    • Add repository-level instrumentation deployment (opt-in, default off)
    • Use checksuite deployment as template
    • Add configuration inputs for repository-level instrumentation
    • Simplify repository detection (only check step.uses)
    • Set workflow name to "OpenTelemetry"
  • Testing & Validation
    • All scripts pass bash syntax validation
    • No critical shellcheck errors
    • Code review completed and feedback addressed
    • CodeQL security scan passed (0 alerts)
    • PR review feedback addressed

Key Changes from Review

  • Separated cicd.* metrics from github.* attributes (cleaner semantic convention compliance)
  • Removed cicd.* attributes from spans (kept on metrics only as requested)
  • Simplified repository event handling with separate case branches
  • Added main.js redirect following established pattern
  • Changed repository workflow name to "OpenTelemetry" for consistency
Original prompt

This section details on the original issue you should resolve

<issue_title>Conforming to OpenTelemetry CI/CD semantic conventions</issue_title>
<issue_description>I believe this project is older than the fairly-recently-established OpenTelemetry SIG for CICD observability, however, semantic conventions for CI/CD are already published. Is there any plan to conform to these attributes, like mapping the corresponding github.* attributes in the workflow-level telemetry to their semconv cicd.* ones?

Thanks!</issue_description>

<agent_instructions>go through all span and metric attributes of the workflow-level, checksuite-level, and job-level instrumentation and check if there is a better / more correct attribute name to replace it with. if they are not a full replacement, do not replace them but add additional attributes (for example, the pipelinename should be the workflow name, but we still wanna keep the github. attribute for that as well, because its more specific. make a case by case choice)
add new metrics that are suggested by the semantic conventions with the required attributes
also, add an entirely new instrumentation type, the "repository-level instrumentation". it should be a dedicated new workflow, that reacts to a few trigger types (like issue created, pull request created/merged) and then send metrics like number of collabroators, open issues, pull requests, merge time, and other metrics suggested by the convention. determine the trigger types necessary.
also adjust the deployment workflow to deploy that new kind of instrumentation, with the check suite being a template. but, compared to the others, make it opt-in and defualt off for now</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 31, 2026 19:05
Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Copilot AI changed the title [WIP] Update attributes to conform to OpenTelemetry CI/CD conventions Add OpenTelemetry CI/CD semantic conventions support Jan 31, 2026
Copilot AI requested a review from plengauer January 31, 2026 19:12
Copy link
Copy Markdown
Owner

@plengauer plengauer left a comment

Choose a reason for hiding this comment

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

@copilot pls address all comments

Comment thread actions/instrument/checksuite/main.sh Outdated
Comment thread actions/instrument/checksuite/main.sh Outdated
Comment thread actions/instrument/deploy/action.yml Outdated
Comment thread actions/instrument/deploy/action.yml Outdated
Comment thread actions/instrument/repository/action.yml Outdated
Comment thread actions/instrument/repository/action.yml
Comment thread actions/instrument/repository/action.yml Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/workflow/main.sh Outdated
… flow

Co-authored-by: plengauer <100447901+plengauer@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot pls address all comments

All comments addressed in commit 2086050:

Attribute refactoring:

  • Removed github.* attributes from cicd metric datapoints (workflow & checksuite)
  • Removed cicd.* attributes from checksuite span (kept only on metrics)

Repository instrumentation improvements:

  • Added token and cache inputs following checksuite pattern
  • Created main.js redirect
  • Simplified control flow (separate case branches, no nested if-else)
  • Updated naming: "OpenTelemetry Repository" action, "OpenTelemetry" workflow
  • Verified all metrics match semantic conventions

Deployment changes:

  • Simplified repository detection (removed on.issues check)

Removed cache input from action.yml
Removed duplicate counter handles for pipeline run duration and errors.
Added OpenTelemetry counters and observations for CI/CD pipeline metrics.
Removed the unused function map_github_conclusion_to_cicd_result.
Refactor event triggers for OpenTelemetry action.
Removed cache input option from action.yml
Removed cache input from action.yml configuration.
Comment out push_null case and related metrics creation.
@plengauer plengauer marked this pull request as ready for review February 6, 2026 23:30
@plengauer plengauer requested a review from moflwi as a code owner February 6, 2026 23:30
Copilot AI review requested due to automatic review settings February 6, 2026 23:30
@plengauer plengauer enabled auto-merge (squash) February 6, 2026 23:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds OpenTelemetry CI/CD semantic conventions by introducing cicd.* attributes/metrics for GitHub Actions workflow/checksuite/job instrumentation, plus a new repository-level instrumentation action and deploy support.

Changes:

  • Add cicd.pipeline.* metrics/attributes (duration/errors/worker/active) across workflow, checksuite, and job instrumentation.
  • Introduce new repository-level instrumentation action that emits VCS semantic convention metrics.
  • Extend deploy action to optionally install the repository-level instrumentation workflow.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
actions/instrument/workflow/main.sh Adds CI/CD metrics and CI/CD-related span attributes for workflow/job/step processing.
actions/instrument/workflow/action.yml Updates action inputs (adds repository, removes cache).
actions/instrument/checksuite/main.sh Adds CI/CD metrics and CI/CD-related span attributes for check runs.
actions/instrument/checksuite/action.yml Updates action inputs (adds repository, removes cache).
actions/instrument/job/inject_and_init.sh Adds CI/CD metrics/attributes for job-level spans and worker/run activity tracking.
actions/instrument/job/decorate_action.sh Adds CI/CD task attributes on decorated action steps.
actions/instrument/repository/main.sh New repository-level instrumentation to emit VCS metrics from GitHub events.
actions/instrument/repository/main.js Node entrypoint that runs the repository main.sh.
actions/instrument/repository/action.yml New GitHub Action definition for repository-level instrumentation.
actions/instrument/deploy/action.yml Adds optional deployment of repository-level instrumentation workflow.

Comment thread actions/instrument/checksuite/main.sh Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/repository/main.sh Outdated
Comment thread actions/instrument/repository/main.js
Comment thread actions/instrument/workflow/action.yml Outdated
Comment thread actions/instrument/workflow/action.yml
Comment thread actions/instrument/checksuite/action.yml
Comment thread actions/instrument/job/inject_and_init.sh
Removed job level instrumentation settings and added repository level instrumentation.
@plengauer
Copy link
Copy Markdown
Owner

!release

plengauer and others added 5 commits February 7, 2026 13:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@plengauer plengauer merged commit 6fd7e8f into main Feb 9, 2026
1652 of 1657 checks passed
@plengauer plengauer deleted the copilot/conform-opentelemetry-semantic branch February 9, 2026 18:17
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.

Conforming to OpenTelemetry CI/CD semantic conventions

4 participants