I am Vladimir Adamiฤ, a freelance software developer from Zagreb, Croatia.
- ๐ซ You can reach me at my website,
- ๐ฌ Ask me about Node.js, JavaScript, TypeScript
- ๐ Pronouns: he/his
License: MIT License
I am Vladimir Adamiฤ, a freelance software developer from Zagreb, Croatia.
What are your thoughts on making the OTel dependencies peerDependencies so that they can be updated without waiting on an otlp-logger
release?
TL;DR What do you think of adding support for custom exporters?
Using the ConsoleLogRecordExporter with pino-opentelemetry-transport, I noticed that the colorization doesn't work locally. This happens because the logger is in a worker thread and process.stdout is not a TTY.
I opened open-telemetry/opentelemetry-js#4524 to add an option to ConsoleLogRecordExporter that would force colorization. However, the OpenTelemetry team suggested implementing a custom exporter as they do not want to expand the API for ConsoleLogRecordExporter (which currently takes no options).
Ultimately, I will likely stick with my workaround of using process.env.FORCE_COLOR=1
. But this is what got me thinking about otlp-logger supporting custom exporters.
A custom exporter just needs to implement the LogRecordExporter interface. The API could look something like this:
const logger = getOtlpLogger({
loggerName: 'my-app',
resourceAttributes: {/* ... */},
serviceVersion: '1.0.0',
logRecordProcessorOptions: {
recordProcessorType: 'batch',
exporterOptions: {
path: path.join(__dirname, 'my-exporter'), // or just 'name-of-custom-exporter-package'
export: 'LogExporter', // optional, assumes default export when omitted
options: {/* ... */} // optional
}
}
})
Why is it that different keys are required to pass options to the different exporters? e.g. When exporterOptions.protocol
is grpc
, you must use exporterOptions.grpcExporterOptions
and when exporterOptions.protocol
is http
, you must use exporterOptions.httpExporterOptions
.
Why not just use exporterOptions.options
for all of them? Is it simply because of the types? If so, are you open to a non-breaking PR to support exporterOptions.options
properly typed with overrides?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.