Skip to content

chore: add os and fs detectors #280

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/github-script@v7
if: ${{ env.PACKAGE }}
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
let tagExists = [];
try {
Expand Down Expand Up @@ -67,8 +67,10 @@ jobs:
id: release
if: ${{ env.PACKAGE }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const { repo: { owner, repo }, sha } = context;
Expand All @@ -85,13 +87,15 @@ jobs:

release_id = release.data.id;
} catch (e) {
let latest;
if (e.status == 422) { // Release alredy exists
latest = await github.rest.repos.getLatestRelease({
owner, repo
if (e.status == 422) { // Release already exists
const latest = await github.rest.repos.getLatestRelease({
owner,
repo
});
release_id = latest.data.id;
} else {
throw e;
}
release_id = latest.data.id;
}

return release_id
Expand Down
10 changes: 5 additions & 5 deletions libs/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import {ConnectInstrumentation} from '@opentelemetry/instrumentation-connect';
import {diag, DiagConsoleLogger, DiagLogLevel} from '@opentelemetry/api';
import {DnsInstrumentation} from '@opentelemetry/instrumentation-dns';
import {ExpressInstrumentation} from '@opentelemetry/instrumentation-express';
import {FastifyInstrumentation} from '@opentelemetry/instrumentation-fastify';
import {HttpInstrumentation} from '@opentelemetry/instrumentation-http';
import {NodeTracerProvider} from '@opentelemetry/sdk-trace-node';
import {OTLPTraceExporter} from '@opentelemetry/exporter-trace-otlp-grpc';
import {PinoInstrumentation} from '@opentelemetry/instrumentation-pino';
import {IORedisInstrumentation} from '@opentelemetry/instrumentation-ioredis';
import {registerInstrumentations} from '@opentelemetry/instrumentation';
import {Resource, detectResourcesSync, envDetector, hostDetector, processDetector} from '@opentelemetry/resources';
import { FsInstrumentation } from '@opentelemetry/instrumentation-fs';
import {Resource, detectResourcesSync, envDetector, hostDetector, osDetector, processDetector} from '@opentelemetry/resources';
import {ATTR_SERVICE_NAME} from '@opentelemetry/semantic-conventions';
import {ATTR_CONTAINER_NAME} from '@opentelemetry/semantic-conventions/incubating';

Expand Down Expand Up @@ -80,7 +80,7 @@ export function setupTracing(options = {}) {
[ATTR_CONTAINER_NAME]: hostname,
}).merge(
detectResourcesSync({
detectors: [envDetector, processDetector, hostDetector]
detectors: [envDetector, hostDetector, osDetector, processDetector]
})
),
});
Expand Down Expand Up @@ -108,12 +108,12 @@ export function setupTracing(options = {}) {
instrumentations: [
new PinoInstrumentation(),
new HttpInstrumentation({ requireParentforOutgoingSpans: false, requireParentforIncomingSpans: false, ignoreIncomingRequestHook, }),
new FastifyInstrumentation(),
new ExpressInstrumentation({ ignoreIncomingRequestHook, }),
new ConnectInstrumentation(),
new AwsInstrumentation({ sqsExtractContextPropagationFromPayload: true, }),
new DnsInstrumentation(),
new IORedisInstrumentation(),
new FsInstrumentation(),
new DnsInstrumentation(),
],
});

Expand Down
23 changes: 11 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@saidsef/tracing-node",
"version": "3.4.4",
"version": "3.4.5",
"description": "tracing NodeJS - Wrapper for OpenTelemetry instrumentation packages",
"main": "libs/index.mjs",
"scripts": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"@opentelemetry/instrumentation-connect": "^0.44.0",
"@opentelemetry/instrumentation-dns": "^0.44.0",
"@opentelemetry/instrumentation-express": "^0.48.0",
"@opentelemetry/instrumentation-fastify": "^0.45.0",
"@opentelemetry/instrumentation-fs": "^0.20.0",
"@opentelemetry/instrumentation-http": "^0.200.0",
"@opentelemetry/instrumentation-ioredis": "^0.48.0",
"@opentelemetry/instrumentation-pino": "^0.47.0",
Expand Down