-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up otel pino stream to deliver logs to otel collector
- Loading branch information
1 parent
e4b2c5e
commit 53b54a3
Showing
9 changed files
with
511 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,4 @@ | |
"engines": { | ||
"node": ">=18" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,4 +101,4 @@ | |
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { awsEc2Detector, awsEcsDetector } from '@opentelemetry/resource-detector-aws'; | ||
import { | ||
type IResource, | ||
detectResourcesSync, | ||
envDetectorSync, | ||
osDetectorSync, | ||
processDetectorSync, | ||
serviceInstanceIdDetectorSync, | ||
} from '@opentelemetry/resources'; | ||
|
||
import { aztecDetector } from './aztec_resource_detector.js'; | ||
|
||
export async function getOtelResource(): Promise<IResource> { | ||
const resource = detectResourcesSync({ | ||
detectors: [ | ||
osDetectorSync, | ||
envDetectorSync, | ||
processDetectorSync, | ||
serviceInstanceIdDetectorSync, | ||
awsEc2Detector, | ||
awsEcsDetector, | ||
aztecDetector, | ||
], | ||
}); | ||
|
||
if (resource.asyncAttributesPending) { | ||
await resource.waitForAsyncAttributes!(); | ||
} | ||
|
||
return resource; | ||
} |
Oops, something went wrong.