mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-29 07:27:22 +08:00
* chore(deps): bump devenv from `e5da2bd` to `ff0d7e7` in the nix group Bumps the nix group with 1 update: [devenv](https://github.com/cachix/devenv). Updates `devenv` from `e5da2bd` to `ff0d7e7` - [Release notes](https://github.com/cachix/devenv/releases) - [Commits](https://github.com/cachix/devenv/compare/e5da2bd81222e2b4faa0483778b50f43d6a08005...ff0d7e76dc83bef8eb4f83f7985ff2d792234440) --- updated-dependencies: - dependency-name: devenv dependency-version: ff0d7e76dc83bef8eb4f83f7985ff2d792234440 dependency-type: direct:production dependency-group: nix ... Signed-off-by: dependabot[bot] <support@github.com> * chore: bump transitive deps * fix: replace sdk-trace-base with sdk-trace --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Tony <TonyRL@users.noreply.github.com>
29 lines
990 B
TypeScript
29 lines
990 B
TypeScript
import { trace } from '@opentelemetry/api';
|
|
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
|
|
import { resourceFromAttributes } from '@opentelemetry/resources';
|
|
import { BatchSpanProcessor, TracerProvider } from '@opentelemetry/sdk-trace';
|
|
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
|
|
|
|
const exporter = new OTLPTraceExporter({
|
|
// optional OTEL_EXPORTER_OTLP_ENDPOINT=https://localhost:4318
|
|
});
|
|
|
|
const provider = new TracerProvider({
|
|
resource: resourceFromAttributes({
|
|
[ATTR_SERVICE_NAME]: 'rsshub',
|
|
}),
|
|
spanProcessors: [
|
|
new BatchSpanProcessor({
|
|
exporter,
|
|
// The maximum queue size. After the size is reached spans are dropped.
|
|
maxQueueSize: 4096,
|
|
// The interval between two consecutive exports
|
|
scheduledDelayMillis: 30000,
|
|
}),
|
|
],
|
|
});
|
|
|
|
trace.setGlobalTracerProvider(provider);
|
|
|
|
export const tracer = provider.getTracer('rsshub');
|