0.28.2 • Published 12 days ago

@opentelemetry/resource-detector-github v0.28.2

Weekly downloads
18
License
Apache-2.0
Repository
github
Last release
12 days ago

OpenTelemetry Resource Detector for GitHub Actions

NPM Published Version Apache License

Resource detector for GitHub Actions.

Detects GITHUB_* environment variables specified here and adds as attributes on a resource.

This is useful for collecting telemetry in GitHub Actions-powered CI/CD workflows.

The OpenTelemetry Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the Resource.

Compatible with OpenTelemetry JS API and SDK 1.0+.

Installation

npm install --save @opentelemetry/resource-detector-github

Usage

const { gitHubDetector } = require('@opentelemetry/opentelemetry-resource-detector-github')

async function run() {
  // Initialize GitHub Resource Detector
  const resource = await gitHubDetector.detect();
};

run()

Available detectors

GitHub Detector

Resource AttributeDescription
github.actorValue of Process Environment Variable GITHUB_ACTOR
github.base_refValue of Process Environment Variable GITHUB_BASE_REF
github.head_refValue of Process Environment Variable GITHUB_HEAD_REF
github.refValue of Process Environment Variable GITHUB_REF
github.run_idValue of Process Environment Variable GITHUB_RUN_ID
github.run_numberValue of Process Environment Variable GITHUB_RUN_NUMBER
github.shaValue of Process Environment Variable GITHUB_SHA
github.workflowValue of Process Environment Variable GITHUB_WORKFLOW

Useful links

License

Apache 2.0 - See LICENSE for more information.

0.28.2

12 days ago

0.28.1

9 months ago

0.28.0

10 months ago

0.27.1

12 months ago

0.27.0

2 years ago

0.26.1

2 years ago

0.26.0

3 years ago

0.25.0

3 years ago

0.24.0

3 years ago

0.23.0

3 years ago

0.22.0

3 years ago

0.21.0

3 years ago

0.20.0

3 years ago

0.16.0

3 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.13.1

3 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.12.0

3 years ago