Add domain to tracing service to distinguish different Matrix public archive instances (#76)
This commit is contained in:
parent
b39d7caf31
commit
ff315141fd
|
@ -19,18 +19,22 @@ const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventi
|
|||
const CaptureSpanProcessor = require('./capture-span-processor');
|
||||
|
||||
const config = require('../lib/config');
|
||||
const basePath = config.get('basePath');
|
||||
assert(basePath);
|
||||
const jaegerTracesEndpoint = config.get('jaegerTracesEndpoint');
|
||||
|
||||
const packageInfo = require('../../package.json');
|
||||
assert(packageInfo.name);
|
||||
|
||||
const basePathUrl = new URL(basePath);
|
||||
|
||||
// (Diagnostics) For troubleshooting, set the log level to DiagLogLevel.DEBUG.
|
||||
//
|
||||
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
|
||||
|
||||
const provider = new BasicTracerProvider({
|
||||
resource: new Resource({
|
||||
[SemanticResourceAttributes.SERVICE_NAME]: packageInfo.name,
|
||||
[SemanticResourceAttributes.SERVICE_NAME]: `${packageInfo.name} - ${basePathUrl.host}`,
|
||||
}),
|
||||
});
|
||||
// Export spans to console (useful for debugging).
|
||||
|
|
Loading…
Reference in New Issue