Class CommonAttributesBuilder


  • public class CommonAttributesBuilder
    extends java.lang.Object
    A builder for Attributes. It provides convenience names for commonly used attributes.
    • Constructor Detail

      • CommonAttributesBuilder

        public CommonAttributesBuilder()
    • Method Detail

      • attributes

        public CommonAttributesBuilder attributes​(Attributes attributes)
        Provides a new set of attributes for this builder
        Parameters:
        attributes - - the new attributes
        Returns:
        this builder
      • serviceName

        public CommonAttributesBuilder serviceName​(java.lang.String serviceName)
        Specifies the service name of the current application. This value will end up in the "service.name" attribute.
        Parameters:
        serviceName - - The name of the service.
        Returns:
        this builder
      • instrumentationProvider

        public CommonAttributesBuilder instrumentationProvider​(java.lang.String instrumentationProvider)
        Specifies the name of the provider of the instrumentation to this builder, for example "micrometer" or "opentelemetry". Users doing manual instrumentation should generally not call this method. This value is intended for use by instrumentation frameworks. The value will end up in the "instrumentation.provider" attribute.
        Parameters:
        instrumentationProvider - - The instrumentation provider name
        Returns:
        this builder
      • build

        public Attributes build()
        Call this lastly to actually build an Attributes instance that optionally contains specially named fields.
        Returns:
        a fresh new Attributes instance