Skip to content

Commit

Permalink
Remove fs instrumentation by default
Browse files Browse the repository at this point in the history
Remove the fs module instrumentation by default as it's causing some
issues with apps, making them unable to start.

Part of #845
  • Loading branch information
tombruijn committed Jan 31, 2023
1 parent 70fb916 commit aa1301d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 63 deletions.
6 changes: 6 additions & 0 deletions .changesets/remove-fs-instrumentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "remove"
---

Remove fs instrumentation by default. It's causing issues on some installations. It can be manually added as [described in our fs module docs](https://docs.appsignal.com/nodejs/3.x/integrations/fsmodule.html).
31 changes: 2 additions & 29 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/instrumentation-express": "^0.32.0",
"@opentelemetry/instrumentation-fastify": "^0.31.0",
"@opentelemetry/instrumentation-fs": "^0.6.0",
"@opentelemetry/instrumentation-graphql": "^0.33.0",
"@opentelemetry/instrumentation-http": "^0.34.0",
"@opentelemetry/instrumentation-ioredis": "^0.33.0",
Expand Down
7 changes: 0 additions & 7 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
ExpressLayerType
} from "@opentelemetry/instrumentation-express"
import { FastifyInstrumentation } from "@opentelemetry/instrumentation-fastify"
import { FsInstrumentation } from "@opentelemetry/instrumentation-fs"
import { GraphQLInstrumentation } from "@opentelemetry/instrumentation-graphql"
import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"
import { IORedisInstrumentation } from "@opentelemetry/instrumentation-ioredis"
Expand Down Expand Up @@ -46,7 +45,6 @@ import { SpanProcessor, TestModeSpanProcessor } from "./span_processor"
const DefaultInstrumentations = {
"@opentelemetry/instrumentation-express": ExpressInstrumentation,
"@opentelemetry/instrumentation-fastify": FastifyInstrumentation,
"@opentelemetry/instrumentation-fs": FsInstrumentation,
"@opentelemetry/instrumentation-graphql": GraphQLInstrumentation,
"@opentelemetry/instrumentation-http": HttpInstrumentation,
"@opentelemetry/instrumentation-ioredis": IORedisInstrumentation,
Expand Down Expand Up @@ -322,11 +320,6 @@ export class Client {
},
"@prisma/instrumentation": {
middleware: true
},
"@opentelemetry/instrumentation-fs": {
createHook: () => {
return trace.getActiveSpan() !== undefined
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion test/express-redis/app/package-lock.json

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

12 changes: 0 additions & 12 deletions test/express-redis/app/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,6 @@ app.get("/custom", (_req: any, res: any) => {
res.send("200 OK")
})

app.get("/filesystem", (_req: any, res: any) => {
const filePath = "package.json"

console.log(`Checking read and write permissions on ${filePath}`)

fs.access(filePath, fs.constants.R_OK | fs.constants.W_OK, err => {
console.log(`${filePath} ${err ? "is not" : "is"} readable and writable`)
})

res.send("200 OK")
})

app.use(expressErrorHandler())

app.listen(port, () => {
Expand Down
13 changes: 0 additions & 13 deletions test/express-redis/tests/spec/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,4 @@
expect(custom_span.attributes["appsignal.tag.custom"]).to eql("tag")
end
end

describe "GET /filesystem" do
it "creates an fs child span" do
response = HTTP.get("#{@test_app_url}/filesystem")
expect(response.status).to eq(200)

expect(Span.root!).to be_http_span_with_route("GET /filesystem")

fs_span = Span.find_by_name!("fs access")
expect(fs_span.parent.id).to eql(Span.root.id)
expect(fs_span.instrumentation_library_name).to eql("@opentelemetry/instrumentation-fs")
end
end
end

0 comments on commit aa1301d

Please sign in to comment.