Open oxcafedead opened 2 months ago
Currently, there is no API to insert custom resource attributes.\ For example, to set deployment.environment semantic attribute from OpenTelemetry Semantic Conventions, one has to do smth like:
deployment.environment
postProcessor: (spans) => { if (spans.length == 0) { return spans; } const resource = spans[0].resource; resource.attributes['deployment.environment'] = env.ENV_NAME; return spans; }
Ideally, would go great to have it configurable
As I am not sure about proper naming / place to put this -- feel free to throw it away or change, but the overall idea is:
return { exporter: { url: tracesEndpoint, }, service: { name: serviceName, version: env.VERSION, }, extraResourceAttributes: parseAttributes(env.OTEL_ATTRS)), ...
Also not sure if we should update readme as this is not an essential config part.
Currently, there is no API to insert custom resource attributes.\ For example, to set
deployment.environment
semantic attribute from OpenTelemetry Semantic Conventions, one has to do smth like:Ideally, would go great to have it configurable
As I am not sure about proper naming / place to put this -- feel free to throw it away or change, but the overall idea is:
Also not sure if we should update readme as this is not an essential config part.