mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 16:14:36 +00:00
ad01714323
## Description: Self hosted grafana has maintenance burden, so migrate to grafana cloud ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I have read and accepted the CLA aggreement (only required once). ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
30 lines
858 B
TypeScript
30 lines
858 B
TypeScript
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
import {
|
|
ATTR_SERVICE_NAME,
|
|
ATTR_SERVICE_VERSION,
|
|
} from "@opentelemetry/semantic-conventions";
|
|
import { getServerConfigFromServer } from "../core/configuration/ConfigLoader";
|
|
|
|
const config = getServerConfigFromServer();
|
|
|
|
export function getOtelResource() {
|
|
return resourceFromAttributes({
|
|
[ATTR_SERVICE_NAME]: "openfront",
|
|
[ATTR_SERVICE_VERSION]: "1.0.0",
|
|
...getPromLabels(),
|
|
});
|
|
}
|
|
|
|
export function getPromLabels() {
|
|
return {
|
|
"service.instance.id": process.env.HOSTNAME,
|
|
"openfront.environment": config.env(),
|
|
"openfront.host": process.env.HOST,
|
|
"openfront.domain": process.env.DOMAIN,
|
|
"openfront.subdomain": process.env.SUBDOMAIN,
|
|
"openfront.component": process.env.WORKER_ID
|
|
? "Worker " + process.env.WORKER_ID
|
|
: "Master",
|
|
};
|
|
}
|