If I understand correctly, I should be able to use an opentelemetry Resource to attach custom Attributes to outgoing Spans. I think the syntax should be something like
Resource resource = Resource.create(Attributes.builder().put("key", "value").build());
SdkTracerProvider sdkTracerProvider = SdkTracerProvider.builder().setResource(resource).build;
Questions:
How do I set that TracerProvider as the default provider for my application?
If I do so, will it add that attribute to the default set of attributes attached to Spans, or will it replace them?
Also, if I do so, would I still be able to use the Span.current() syntax to access the current Span, or would I need to access the current Span through the Tracer?