feat(server): OpenTelemetry integration (#7356)

* wip

* span class decorator

fix typing

* improvements

* noisy postgres logs

formatting

* add source

* strict string comparison

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>

* remove debug code

* execution time histogram

* remove prometheus stuff

remove prometheus data

* disable by default

disable nestjs-otel stuff by default

update imports

* re-add postgres instrumentation

formatting

formatting

* refactor: execution time histogram

* decorator alias

* formatting

* keep original method order in filesystem repo

* linting

* enable otel sdk in e2e

* actually enable otel sdk in e2e

* share exclude paths

* formatting

* fix rebase

* more buckets

* add example setup

* add envs

fix

actual fix

* linting

* update comments

* update docker env

* use more specific env

---------

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Mert
2024-03-12 01:19:12 -04:00
committed by GitHub
parent def82a7354
commit a097e903c9
42 changed files with 3268 additions and 89 deletions
@@ -13,23 +13,37 @@ import archiver from 'archiver';
import chokidar, { WatchOptions } from 'chokidar';
import { glob } from 'fast-glob';
import { constants, createReadStream, existsSync, mkdirSync } from 'node:fs';
import fs, { copyFile, readdir, rename, stat, utimes, writeFile } from 'node:fs/promises';
import fs from 'node:fs/promises';
import path from 'node:path';
import { Instrumentation } from '../instrumentation';
@Instrumentation()
export class FilesystemProvider implements IStorageRepository {
private logger = new ImmichLogger(FilesystemProvider.name);
readdir = readdir;
readdir(folder: string): Promise<string[]> {
return fs.readdir(folder);
}
copyFile = copyFile;
copyFile(source: string, target: string) {
return fs.copyFile(source, target);
}
stat = stat;
stat(filepath: string) {
return fs.stat(filepath);
}
writeFile = writeFile;
writeFile(filepath: string, buffer: Buffer) {
return fs.writeFile(filepath, buffer);
}
rename = rename;
rename(source: string, target: string) {
return fs.rename(source, target);
}
utimes = utimes;
utimes(filepath: string, atime: Date, mtime: Date) {
return fs.utimes(filepath, atime, mtime);
}
createZipStream(): ImmichZipStream {
const archive = archiver('zip', { store: true });